[prev] 5 [next]

Priority Queues

Some applications of queues require
  • items processed in order of "key"
  • rather than in order of entry (FIFO)
Priority Queues (PQueues or PQs) provide this via:
  • join: insert item into PQ
  • leave: remove item with largest/smallest key
  • remove: remove item with specified key
Plus generic ADT operations: new, dispose, isEmpty, ...


Priority order may involve "weight" based on other factors than just key