A heap is a data structure that orders elements the same way as a Priority Queue, according to some assigned priority.

  • The highest priority element (min or max) sits at the top of the heap.
  • Maintains partial ordering, which is less expensive that full sorting but better than no ordering.
  • A complete tree is where the highest