Heap Sort

Subpage of Algorithms

Recurrences, asymptotics, and design techniques.

Like insertion sort, but unlike merge sort, heapsort sorts in place: only a constant number of array elements are stored outside the input array at any time. Thus, heapsort combines the better attributes of the two sorting algorithms

This uses the heap data structure to achieve \(O(n\log{n})\) sorting.