A queue data structure — with value semantics— whose elements are dequeued by priority order.
Priority of one element over another is defined via a strict ordering function given at creation time and
invariable during the life time of an instance.
Such that given sort
as the ordering function, then for any elements a
, b
, and c
,
the following conditions must hold:
sort(a, a)
is alwaysfalse
. (Irreflexivity)- If
sort(a, b)
andsort(b, c)
are bothtrue
, thensort(a, c)
is alsotrue
. ( Transitive comparability) - Two elements are incomparable if neither is ordered before the other according to the sort function.
If
a
andb
are incomparable, andb
andc
are incomparable, thena
andc
are also incomparable. (Transitive incomparability)