Heap Sort

So what is Heap Sort?

Recall the Heap Sort is only the use of insert and extract to sort an array. We have learnt both these operations, now we will just use them together to get an increasing array.

  • Insert all n elements into the heap (Build Heap).
  • Keep popping out the smallest element in the array.