Heap Sort

Use a Binary Heap to sort an array

Out of Place

  • How
    1. Insert n items into heap ( + extra space)
    2. Extract n items from heap and place in array ()
  • Performance:

In Place

  • How
    1. Sort array in place ()
    2. Extract n items from heap and place in array ()
for (int i = size / 2; i>= 0; i--)
	heapifyDown(i)
  • Performance: