Heaps

Priority queues, heap operations, and top-K.

Operations

Insert (sift-up) and extract (sift-down).

Checkpoint

A graded check on heap invariants, repair operations, and top-k.

Pattern Quest

Practice recognizing heaps problem shapes.

Heaps

Practice keeping the deciding candidate at a heap root: balanced heaps for a running median or rank, a free heap and a busy heap for scheduling, and lazy deletion when a stored priority goes stale.