堆排序

Create a heap for all records.

You can get the sorted sequence by taking the top elements of the heap one by one.

Time complexity is O(n\log n) .


评论