Priority Queue ADT
overview
Remember these Terms
- Priority queue: structure that returns the highest-priority item first.
- Priority: numeric or comparable rank used to order items.
- Max-heap / Min-heap: heap variants that give largest or smallest item first.
- Push / Enqueue: insert an item, typically O(log n) with a heap.
- Pop / Extract: remove and return the top item, O(log n).
- Peek / Top: read the current top item in O(1).
- Comparator: function that decides ordering, for example less or greater.
- Heap property: every parent has priority at least that of children.