Skip to main content
Log in

The least basic operations on heap and improved heapsort

  • Published:
Journal of Computer Science and Technology Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Aho A V,et al. The design and analysis of computer algorithms. Addison-Wesley, Reading, MA, 1976, pp. 87–92.

    Google Scholar 

  2. Cook C, Kim D. Best sorting algorithm for nearly sorted lists.CACM, 1980, 23(11): 620–626.

    Google Scholar 

  3. Gu Xunrang, Zhu Yuzhang. Improved heapsort algorithm and its complexity analysis.Chinese Journal of Computers, 1990, 13(4): 289–292.

    Google Scholar 

  4. Zhu Honget al. The design and analysis of algorithm (in Chinese). Shanghai Scientific and Technological Literature Publishing House, 1989, pp. 15–32.

  5. Hayward R, Mcdiarmid C. Average case analysis of heap building by repeated insertion.Journal of Algorithms, 1991, 12(1).

  6. 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.

Download references

Author information

Authors and Affiliations

Authors

Additional information

Supported by National Natural Science Foundation of China under Grant 6907330.

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Revised:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF02939507

Keywords

Navigation