Medium

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

CategoryData Structure
DifficultyMedium
Peek maximumO(1)
InsertO(log n)
Extract maximumO(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.