Skip to main content
Log in

Inserting a new element into a heap

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

Abstract

In this paper a well-known algorithm is studied which accomplishes the insertion of a new element into a heap. Under the assumption of uniformly distributed heaps and new elements, respectively, an explicit expression for the expected number of comparisons in terms of the binary representation of the number of elements in the heap is derived. From this, higher moments are calculated and asymptotically evaluated. Some numerical evidence is given that the mathematically derived results agree with results obtained in a simulation.

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., Hopcroft, J. E., Ullman, J. D.:The Design and Analysis of Algorithms. Addison-Wesley, Reading, Mass., 1974.

    Google Scholar 

  2. Bender, E. A.:Asymptotic methods in enumeration. SIAM Review 16 (1974), 485–515.

    Google Scholar 

  3. Bromwich, T. J. I'A:An Introduction to the Theory of Infinite Series. Macmillan, London, 1926 (Second Edition).

    Google Scholar 

  4. Darboux, G.: Mémoire sur l'approximation des fonctions des trés grand nombres, J. de Mathématiques (3) 6 (1878), 1–56, 377–416.

    Google Scholar 

  5. Doberkat, E.-E.:Some observations on the average behavior of heapsort—preliminary report. 21st IEEE FOCS, Syracuse, N.Y., (1980), 229–237.

  6. Doberkat, E.-E.:Inserting a new element into a heap. Informatik-Berichte 5, Fernuniversität Hagen, 1980.

  7. Feller, W.:Introduction to Probability Theory and its Applications, vol. I. John Wiley and Sons, New York, 1968 (Third Edition).

    Google Scholar 

  8. Habermann, A. N.:Introduction to Operating System Design. Science Research Associates, Chicago, 1976.

    Google Scholar 

  9. Hansen, E. R.:A Table of Series and Products. Prentice-Hall, Englewood Cliffs, N.J., 1975.

    Google Scholar 

  10. Knuth, D. E.:The Art of Computer Programming, vol. I—Fundamental Algorithms. Addison-Wesley, Reading, Mass., 1973 (Second Edition).

    Google Scholar 

  11. Knuth, D. E.:The Art of Computer Programming. vol. III—Sorting and Searching. Addison-Wesley, Reading, Mass., 1973.

    Google Scholar 

  12. Porter, Th. Simon, I.:Random insertion into a priority queue structure. IEEE Trans. Software Engineering, SE-1 (1975), 292–298.

    Google Scholar 

  13. Rudin, W.:Real and Complex Analysis. Tata McGraw Hill, New Delhi, 1974 (Second Edition).

    Google Scholar 

  14. Whittaker, E.T., Watson, G. N.:A Course of Modern Analysis. Cambridge University Press, 1927 (Fourth Edition).

  15. Williams, J. W. J.:Algorithm 232:Heapsort. Comm. ACM 7 (1964), 347–348.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

Some results of this paper have been presented at the 1981 Conference on Information Sciences and Systems, Johns Hopkins University, Baltimore.

Sponsored in part by the Institute of Educational Informatics, Forschungs- und Entwicklungszentrum für objektivierte Lehr- und Lernverfahren, Paderborn.

(on leave to the Dept. of Mathematics and Computer Science, Clarkson College of Technology, Potsdam, N.Y. 13676, U.S.A.)

Rights and permissions

Reprints and permissions

About this article

Cite this article

Doberkat, EE. Inserting a new element into a heap. BIT 21, 255–269 (1981). https://doi.org/10.1007/BF01941462

Download citation

  • Received:

  • Revised:

  • Issue Date:

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

Keywords

Navigation