- Max / Min Heap
2. Binary Heap
3. Peek -> O(1)
4. Search -> Worst: O(n) / Average: O(n/2) =~ O(n)
5. Insert / Extract -> Heapify -> Height of the Tree -> Worst Case: O(log(n))
6. Binary Heap can be implemented in Array, which can save us some space.
2. Binary Heap
3. Peek -> O(1)
4. Search -> Worst: O(n) / Average: O(n/2) =~ O(n)
5. Insert / Extract -> Heapify -> Height of the Tree -> Worst Case: O(log(n))
6. Binary Heap can be implemented in Array, which can save us some space.