Data Structures & Algorithms · Core algorithms
Heaps & priority queues
A heap always hands you the smallest (or largest) item in O(log n). It powers schedulers, top-K queries, order matching and Dijkstra.
Step 1 of 7 · Overview25 min read ·
Key idea
Prereqs: Big-O, Sorting & binary search. Next: Graphs & BFS. MIT 6.006 Lecture 8 (Binary Heaps).Next: 1. The problem a heap solves