Skip to content

Build a Priority Queue / Heap

Build a binary heap from scratch: the array layout, sift-up/sift-down, push/pop/peek, O(n) heapify, indexed heap with decrease-key, top-K streaming, median finding, and merge K sorted lists. The data structure behind Dijkstra, Huffman, and most schedulers.

beginnerFree2 hours8 lessons
Start learningor sign up to track progress

Curriculum

Loading reference solution…
Build a Priority Queue / Heap