← Back to Sorting Algorithms

Heap Sort

Comparisons: 0
Swaps: 0
Array Accesses: 0
Phase: Ready
Status: Ready

Heap Sort

Build a max-heap from the array, then repeatedly extract the maximum to the end. Two phases: heapify, then extract.

Time: O(n log n) guaranteed
Space: O(1) in-place
Stable: No

Top: bar chart. Bottom: binary tree view showing heap structure and sift-down paths.