At school we are currently learning sorting algorithms in Java and I got for my homework the Heap Sort. I did my reading, I tried to find out as much as I could, but it seems I
Suppose you have a special data structure (called a heap) which allows you to store a list of numbers and lets you retrieve and remove the smallest one in O(lg n)
time.
Do you see how this leads to a very simple sorting algorithm?
The hard part (it's actually not that hard) is implementing the heap.