10 lessons · DSA pattern
Heap
A heap is a tree packed into a list: the root is always the smallest item (min-heap) or the largest (max-heap), and push and pop cost O(log n). You already…
Start learning →A heap is a tree packed into a list: the root is always the smallest item (min-heap) or the largest (max-heap), and push and pop cost O(log n). You already…
Start learning →