All challenges
intermediateData Structures & Algorithms~55 min

Priority Queue & Scheduler (Heap)

Build a binary min-heap from scratch and grow it into a real task scheduler. You will implement push and sift-up, then pop and sift-down, an O(n) heapify, a priority queue that breaks ties by insertion order, and finally a top-K selector. No heapq, no imports — just an array and the parent/child index math that makes heaps fast.