Skip to content

Priority Queues

Bruno Fernandes edited this page Nov 11, 2018 · 2 revisions

Max-oriented priority queues have a similar API to ordinary queues.

They support two key operations:

  • Push - pushes an item onto the priority queue,
  • Pop - removes and returns the largest item in the priority queue.

A single implementation, the BinaryHeap, is available.

Both Push and Pop take linearithmic time, and the memory the heap occupies is proportional to the number of items it holds.

Clone this wiki locally