Max Heap
A max heap keeps the largest item at the root. The shape and the costs match a min heap, with the comparison flipped.
Costs
| Category | Data Structure |
| Difficulty | Medium |
| Peek maximum | O(1) |
| Insert | O(log n) |
| Extract maximum | O(log n) |
Questions
What is Max Heap?
A max heap keeps the largest item at the root. The shape and the costs match a min heap, with the comparison flipped.
Where do I practice it?
DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.