The heap data structure is an array object than can be viewd as a complete binary tree. Heapsort algorithm mainly utilizes the property of the max-heap or min-heap (the program below introduces the max-heap) to sort the array and costs O(nlg n) ,which is asymptotically optimal comparison sort.
Please refer to Introduction to Algorithms to get more details about the heapsort.
本文介绍了一种基于最大堆(Max-Heap)特性的堆排序算法,详细解释了如何通过维护最大堆特性对数组进行排序,并提供了完整的C++实现代码。堆排序的时间复杂度为O(n log n),是一种渐进最优的比较排序算法。

234

被折叠的 条评论
为什么被折叠?



