Heap
Sifting
Swapping
Sorted

Controls

Time: O(n log n) always | Space: O(1) | Not stable

Steps

0 steps

Press Run to trace the algorithm one step at a time.