Heap Sort

Builds a max-heap in the array, then repeatedly swaps the root maximum to the end and re-heapifies.

Intermediateheapin-placeunstableO(n log n)
Loading visualization…