This story shows the Heap sort program in C:
Below is the heapify function:
Below code segment shows the heap sort and build_heap functions:
Can we write this with no recursions? Suppose if the given data is in decreasing order, stack space will be so high I feel.