文件名称:Heap-Sort-Algorithm-Pseudo-Code
介绍说明--下载内容均来自于网络,请自行研究使用
The heapsort algorithm can be divided into two parts.
In the first step, a heap is built out of the data.
In the second step, a sorted array is created by repeatedly removing the largest element from the heap, and inserting it into the array. The heap is reconstructed after each removal. Once all objects have been removed from the heap, we have a sorted array. The direction of the sorted elements can be varied by choosing a min-heap or max-heap in step one.
Heapsort can be performed in place. The array can be split into two parts, the sorted array and the heap.The heap s invariant is preserved after each extraction, so the only cost is that of extraction.
In the first step, a heap is built out of the data.
In the second step, a sorted array is created by repeatedly removing the largest element from the heap, and inserting it into the array. The heap is reconstructed after each removal. Once all objects have been removed from the heap, we have a sorted array. The direction of the sorted elements can be varied by choosing a min-heap or max-heap in step one.
Heapsort can be performed in place. The array can be split into two parts, the sorted array and the heap.The heap s invariant is preserved after each extraction, so the only cost is that of extraction.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Heap Sort Algorithm Pseudo-Code.doc