priority queue

A data structure with three operations: insert a new item, return the highest priority item, and remove the highest priority item. The obvious way to represent priority queues is by maintaining a sorted list but this can make the insert operation very slow. Greater efficiency can be achieved by using heaps.