Heapsort


Heapsort. Insert the integer at the end and reheap up, repeat, then swap the root and end, remove the end, reheap the root down, repeat.