Algo Visualizer
Size:30
1x
Sorting Visualizer

Heap Sort

Step 1 of 6

Heap Sort uses a max-heap data structure to find the largest element efficiently, then repeatedly extracts it to build a sorted array.

Build Max Heap

Transform the array into a max-heap where every parent node is greater than its children.

[8]
[6][5]
[1][2][4][3]
Max Heap — root is largest