PrioQueue (gb.data)
A PrioQueue, short for Priority
Queue, is a more general type of Queue where all inserted elements are not strictly linearly queued. Instead they are first grouped by their priority index. The greater that index, the more important and thus the closer to the beginning of the PrioQueue this group is enqueued. With each group, the usual FIFO semantics of a Queue apply. So that, in effect, all elements can be ordered linearly again.
To range the PrioQueue into your mental hierarchy of concepts, observe that you can implement both a Queue and a Stack by using a PrioQueue: For each element to insert, get a
logical timestamp. If you are building a Queue, this is your priority. If you are building a Stack, flip the sign of this number and this is your priority.
More information on priority queues is available on
Wikipedia.
Vlastnosti
Metoda
See also
PrioSet