- A heap is a tree-based data structure in which all the nodes of the tree are in a specific order.
- Max Heap: Stack but of k elements + Sorted + Topmost element is minima (base is filled with maximums)
- Min Heap: Stack but of k elements + Sorted + Topmost element is maxima (base is filled with minimums)
Both condition must be there
- mention of k elements
- top / largest / smallest / least
- top() => get topmost element (max for minHeap and min for maxHeap)
- push and pop operation but performed only on topmost elements