Heap Sort
Build a max-heap in O(n) in-place, then repeatedly swap the root maximum to the shrinking tail in O(n log n).
Related problems 1
-
Relative Ranks
Build a max-heap in O(n) in-place, then repeatedly swap the root maximum to the shrinking tail in O(n log n).