Heap Sort is the third of the famous n log n sorts. Heap Sort is an in-place comparison sort. In the example program given below a Max-Heap is used to sort the list of numbers. on average the Heap Sort is slightly poorer when compared with Quick Sort. But the worst case time of Heap Sort is still O(n log n).
Click here to download the C Program to perform Heap Sort.
Click here to download the C++ Program to perform Heap Sort.