Skip to content

priority queue

  • A priority queue is a generalization of a queue where each element is assigned a priority and elements come out in order by priority.
  • Priority queue is an abstract data type supporting the following main operations:
  • Insert\(p\) adds a new element with priority p
  • ExtractMax() extracts an element with maximum priority.
  • Remove\(it\) removes an element pointed by an iterator it
  • GetMax() returns an element with maximum priority \(without changing the set of elements\)
  • ChangePriority\(it, p\) changes the priority of an element pointed by it to p
  • more info on pdf: pdf slides