Skip to content

Heap sort

ordering

Level 3 of 3

Read the row as a tree, each number with up to two children, and make every number at least as big as its children, so the biggest is at the top. Swap it to the end, where it stays, mend the tree, and repeat.

the row

the row as a tree

comparisons
0
swaps
0

step 1 of 1

Examples

Whole numbers from 1 to 99, between 2 and 7 of them, separated by commas or spaces.