Heap sort
mediumThe tree and the array below it are the same memory - watch a swap change both at once. The only sort here with an O(n log n) guarantee and O(1) extra space.
Best
O(n log n)Average O(n log n)Worst O(n log n)Space O(1)Not stableIn placeLoading the heap sort engine…