Part V · Trees, Priority Structures and Range Queries
27. Heaps and Priority Queues
7 lessons•35 topics•Intermediate / Advanced
7 of 7 lessons published
27.014 animated
Heap theory
- Complete binary tree
- Heap-order property
- Array index relations
- Min heap
- Max heap
27.026 animated
Heap operations
- Sift up
- Sift down
- Insert
- Peek
- Extract-min/max
- Replace root
- Build-heap in O(n)
27.034 animated
Heap algorithm design
- Heap sort
- Top-K elements
- Kth largest stream
- Merge K sorted lists/arrays
27.044 animated
Dual heap problems
- Online median
- Sliding-window median
- Lazy deletion
- Two-heap balancing
27.054 animated
Priority scheduling
- Event simulation
- Weighted task scheduling
- Dijkstra queue
- Best-first search
- Huffman construction
27.062 animated
Specialized heaps
- D-ary heap
- Binomial heap
- Fibonacci heap
- Pairing heap
- Indexed priority queue
- Decrease-key
27.07Lesson
Java PriorityQueue
- Natural vs custom comparator
- Min-heap default
- Max-heap comparator
- Lack of efficient arbitrary removal