Skip to main content

A Tight Bound on the Worst-Case Number of Comparisons for Floyd’s Heap Construction Algorithm

  • Conference paper
  • First Online:
Book cover Optimization Theory, Decision Making, and Operations Research Applications

Part of the book series: Springer Proceedings in Mathematics & Statistics ((PROMS,volume 31))

Abstract

In this paper a tight bound on the worst-case number of comparisons for Floyd’s well-known heap construction algorithm is derived.1 It is shown that at most \(2n - 2\mu (n) - \sigma (n)\) comparisons are executed in the worst case, where μ(n) is the number of ones and σ(n) is the number of zeros after the last one in the binary representation of the number of keys n.

1This paper was also presented at Student Research Forum of SOFSEM’11 [Paparrizos, A tight bound on the worst-case number of comparisons for Floyd’s heap construction algorithm (2011)].

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 109.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Aho, A.V., Hopcroft, J.E., Ullman, J.D.: The Design and Analysis of Computer Algorithms. Addison-Wesley Series in Computer Science and Information Processing, Addison-Wesley Publishing Company (1974)

    MATH  Google Scholar 

  2. Cormen, T., Leiserson, C., Rivest, R., Stein, C.: Introduction to Algorithms, 2nd edn. MIT, Cambridge (2001)

    MATH  Google Scholar 

  3. Floyd, R.: Algorithm 245: treesort 3. Comm. ACM 7, 701 (1964)

    Article  Google Scholar 

  4. Goodrich, M.T., Tamassia, R.: Algorithm Design, Foundations, Analysis, and Internet Examples. Wiley, New York (2002)

    MATH  Google Scholar 

  5. Knuth, D.: The art of computer programming, vol. 3, 2nd edn. Searching and Sorting. Addison Wesley, Redwood city (1998)

    Google Scholar 

  6. Kruskal, C.P., Weixelbaum, D.: The worst case analysis of heapsort. Technical Report no 018a, Department of Computer Science, New York University (1979)

    Google Scholar 

  7. Paparrizos, I.: A tight bound on the worst-case number of comparisons for Floyd’s heap construction algorithm. In: Proceedings of the 37th International Conference on Current Trends in Theory and Practice of Computer Science (2011)

    Google Scholar 

  8. Schaffer, R.: Analysis of heapsort. Ph.D. Thesis, Department of computer science, Princeton University (1992)

    Google Scholar 

  9. Williams, J.W.J.: Algorithm 232: heapsort. Comm. ACM 6, 347–348 (1964)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ioannis Paparrizos .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer Science+Business Media New York

About this paper

Cite this paper

Paparrizos, I. (2013). A Tight Bound on the Worst-Case Number of Comparisons for Floyd’s Heap Construction Algorithm. In: Migdalas, A., Sifaleras, A., Georgiadis, C., Papathanasiou, J., Stiakakis, E. (eds) Optimization Theory, Decision Making, and Operations Research Applications. Springer Proceedings in Mathematics & Statistics, vol 31. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-5134-1_10

Download citation

Publish with us

Policies and ethics