Heap sort
Build a max-heap in the array, then keep moving its top to the end.
Values4, 10, 3, 5, 1, 8, 7
Start with 4, 10, 3, 5, 1, 8, 7. First build a max-heap: every parent at least as big as its children.
- compare
- swap or write
- settled
Space play · ← → step · Home End jump · drag the strip to scrub