Priority Queue

With Heap

  • Mapping application objects and heap elements
    • Using handles, the details are opaque to the queue.
    • Store the mapping entirely inside the queue (e.g. using hash-table)
  • To increase the key, compare the key with the parent, and “float up”, until the max-heap property holds.
  • To insert a key, first insert it to the end with the lowest key, then increase its key.