Heap Sort Visualizer

Binary heap construction, heapify, and extract operations

Size: 15
Speed:
Array View
Comparisons
0
Swaps
0
Phase
Idle
Heap Type
Min-Heap
Ready. Generate an array and click Sort or Step.

How Heap Sort Works

Heap sort operates in two phases:

Time complexity: O(n log n) in all cases. Space: O(1) auxiliary. Not stable.

Yellow = comparing, Red = swapping, Teal = sorted/extracted.