Sorting Lab

Heap Sort

Turn the array into a binary heap, then extract the max one node at a time. Learn how sift-down keeps the heap valid.

Dataset

Use commas or spaces between values.

Heap sort is in-place and runs in O(n log n) time.

Step-by-step reasoning

See heap builds and extractions.

  1. Run the algorithm to populate steps.