Skip to main content
Log in

Improving worst-case behavior of heaps

  • Part I Computer Science
  • Published:
BIT Numerical Mathematics Aims and scope Submit manuscript

Abstract

It is possible to improve the worst-case behavior of operations on heaps, when counting number of comparisons between elements in the heap, by modifying the traditional binary heap. The improvement suggested is the use of a heap with “scattered” leaves. This method can be combined with the use of a ternary heap for even greater improvement.

Some other improvements of worst-case behavior compared to standard algorithms are discussed at the end of the paper, where the gain of at least (N-2) comparisons when sortingN elements with HEAPSORT is of great interest in implementations. An algorithm for inserting a new element in a heap inO(log logn) comparisons between elements is mentioned.

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. S. Carlsson,Improving worst-case behavior of heaps, Report LUNFD6/(NFCS-3004)/(1–21)/(1983), Department of Computer Science, Lund University, (1983).

  2. H. Erkiö,On heapsort and its dependence on input data, Report A-1979-1, Department of Computer Science, University of Helsinki, (1979).

  3. F. Göbel and C. Hoede,On an optimality property of ternary trees, Inform. Contr. 42 (1979), 10–26.

    Article  Google Scholar 

  4. D. E. Knuth,The Art of Computer Programming, Vol. 3:Sorting and Searching (2nd printing). Addison-Wesley, (1975).

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Carlsson, S. Improving worst-case behavior of heaps. BIT 24, 14–18 (1984). https://doi.org/10.1007/BF01934511

Download citation

  • Received:

  • Revised:

  • Issue Date:

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

Keywords

Navigation