Abstract
The best algorithms of INSERT and DELETE operations on heap is presented, by which HEAPSORT is improved. Inserting one element into and deleting one element from a heap ofn elements spend at most ⌈log logn⌉ comparisons and ⌊logn⌋ comparisons and transfers of element in the worst cases respectively. The improved HEAPSORT spendsn logn+n log logn+O(n) comparisons and element trnasfers (not swap!) in the worst case. It may be the best HEAPSORT algorithm since the lower bound of sorting algorithm ⌈logn!⌉ ≈n logn+O(n). Especially, in element transfer, this is the best result we known so far.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Aho A V,et al. The design and analysis of computer algorithms. Addison-Wesley, Reading, MA, 1976, pp. 87–92.
Cook C, Kim D. Best sorting algorithm for nearly sorted lists.CACM, 1980, 23(11): 620–626.
Gu Xunrang, Zhu Yuzhang. Improved heapsort algorithm and its complexity analysis.Chinese Journal of Computers, 1990, 13(4): 289–292.
Zhu Honget al. The design and analysis of algorithm (in Chinese). Shanghai Scientific and Technological Literature Publishing House, 1989, pp. 15–32.
Hayward R, Mcdiarmid C. Average case analysis of heap building by repeated insertion.Journal of Algorithms, 1991, 12(1).
Reinhardt K. Sorting in-place with a worst case complexity ofn logn−1.3n+O(logn) comparisons and ∈n logn+O (1) transports. In: Proc. 3rd Annual Int'l Symp. Algorithms and Computation, 1992.
Author information
Authors and Affiliations
Additional information
Supported by National Natural Science Foundation of China under Grant 6907330.
Rights and permissions
About this article
Cite this article
Wu, J., Zhu, H. The least basic operations on heap and improved heapsort. J. of Compt. Sci. & Technol. 9, 261–266 (1994). https://doi.org/10.1007/BF02939507
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF02939507