Heap / Priority Queue Visualizers

7

Step through every Heap / Priority Queue problem with animated runtime state, source highlighting, and curated test cases. Built for coding-interview prep and durable algorithmic intuition.

Find Median from Data Stream
Computes the running median of an incoming stream of numbers efficiently by balancing a Max-Heap and a Min-Heap.
Heap / Priority Queue
Kth Largest Element in a Stream
Maintain a size-k min-heap across streamed adds so the root is always the current kth largest.
Heap / Priority Queue
Kth Largest Element in an Array
Keep a min-heap of size k while scanning nums; the root ends up as the kth largest.
Heap / Priority Queue
Kth Smallest Element in a Sorted Matrix
Seed a min-heap with the first column, then pop k-1 times, pushing each popped cell's right neighbor.
Heap / Priority Queue
Last Stone Weight
Repeatedly smash the two heaviest stones in a max-heap until at most one stone remains.
Heap / Priority Queue
Min-Heap Operations
Insert values with bubble-up, then extract-min with sift-down. Watch the tree and array in sync.
Heap / Priority Queue
Top K Frequent Elements
Count frequencies, then push into a min-heap keyed by frequency and cap it at size k.
Heap / Priority Queue