Priority Queues

A (regular) queue has first-in, first-out (FIFO) behavior, where items must enter at the tail and leave from the head.

In a priority queue items must leave from the head, but they enter on the basis of a priority (key) value.

The queue is kept sorted by the key value.