Heap Sort Basic Information
suggest changeHeap sort is a comparison based sorting technique on binary heap data structure. It is similar to selection sort in which we first find the maximum element and put it at the end of the data structure. Then repeat the same process for the remaining items.
Pseudo code for Heap Sort:
function heapsort(input, count)
heapify(a,count)
end <- count - 1
while end -> 0 do
swap(a[end],a[0])
end<-end-1
restore(a, 0, end)
function heapify(a, count)
start <- parent(count - 1)
while start >= 0 do
restore(a, start, count - 1)
start <- start - 1
Example of Heap Sort:

Auxiliary Space: O(1)
Time Complexity: O(nlogn)
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents
2 Sorting
5 Graphs
12 Merge Sort
14 Trees
22 Bucket Sort
23 Quicksort
27 Cycle Sort
28 Heap Sort
32 Radix Sort
35 Pseudocode
39 Shell Sort
41 Pancake Sort
48 Line drawing
66 Contributors