A comparison-based sorting algorithm that uses a binary heap data structure. It divides the input into a sorted and an unsorted region, and iteratively shrinks the unsorted region by extracting the largest element.
Click 'Sort' to start visualization
Step: 0/0
1. Build max heap from array
2. Extract maximum element and place at end
3. Heapify reduced heap
4. Repeat until array is sorted