Question 61
Which sorting algorithm is comparison-based and guarantees O(n log n) worst-case time while sorting in-place?
Heap sort builds a heap and repeatedly swaps the root with the last unsorted element, then restores the heap. Its worst-case time is O(n log n).