Heap Sort
Use a Binary Heap to sort an array
Out of Place
- How
- Insert n items into heap ( + extra space)
- Extract n items from heap and place in array ()
- Performance:
In Place
- How
- Sort array in place ()
- Extract n items from heap and place in array ()
for (int i = size / 2; i>= 0; i--)
heapifyDown(i)
- Performance: