A priority queue is an abstract data type supporting the following two operations:
- add an element to the queue with an associated priority
- remove the element from the queue that has the highest priority, and return it
This makes removing an element O(n) in the number of elements in the queue, which is somewhat inefficient if the queue gets large; a heap is a more efficient way to implement a priority queue for a large number of elements.
See also: scheduling
External links