Priority queues, heaps, and heapsort.
- Priority Queue ADT: getLargest(), insert(), remove().
- How does one implement a priority queue using an array, unsorted array, tree, ...
- Heaps:
- "Close to perfect" tree stored as an array. What are parentIndex() and leftChildIndex(), rightChildIndex() functions?
- What is a Heap?:
- Heap property: a node's key must be larger than or equal to the keys of either child.
- In a heap, every node satisfies the heap property.
- Methods: filterUp(), filterDown, buildHeap, heapSort
- How do we implement a priority queue using a heap?
- Animation
- Description