AntInLoop

Heap Sort Game — Extract-Max & Sift-Down Challenge

Swap root max arr[0] with the unsorted tail and sift down within the shrinking Max-Heap in O(1) extra space.

Time Complexity: O(n log n)

Study the algorithm · Watch Visualizer · All Algorithm Games