AlgoScope

Max Heap

Data structureintermediateHeaps

A binary heap whose root is the largest value.

Decision · step 3 of 11Binary Heap: Build a max heap
895327current7 > 2

Its left child 7 is larger, so 2 sinks and 7 takes its place.

Open in the player →or start at step 3

What you will see

Large values float up; heap sort repeatedly removes the root.

How binary heap works →

Cost

insertO(log n)
extract maxO(log n)
peekO(1)
SpaceO(n)

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, try operations in any order.

Screen readers: Each element is an accessibility element with position, value and state; structural changes are announced per step.

Reduced motion: Elements appear at their destination with a crossfade; no travel longer than the element's own size.

Before this

A variant of

Taught by the same lesson

Binary Heap covers these too, in the same run.