The distribution of keys in a binary heap

  • Mark Allen Weiss
  • Jainendra K. Navlakha
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 382)


We show that the k th smallest element in a large heap is at expected depth ≤log k. Simulation results indicate that this bound is tight, and that the variance of the depth is no more than 0.8, independent of k.

This leads to a simple algorithm for actually finding the k th smallest element that appears to run in O(k) expected time, which would improve the previous best-known bound of O(klog k). We prove an Ω(klog k) lower bound for worst case running time of any algorithm to solve this problem.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

6. References

  1. [1]
    Atallah M.J, and Kosaraju S.R, "An Adversary Lower Bound For Sorting", Information Processing Letters", 13, 2 (1981), 55–57.CrossRefGoogle Scholar
  2. [2]
    Floyd, R. and Rivest, R., "Expected Time Bounds for Selection", Communications of the ACM, 18, (1975), 165–172.CrossRefGoogle Scholar
  3. [3]
    Fredman, M.L. and Tarjan, R.E., "Fibonacci heaps and their uses in improved network optimization algorithms, Journal of the ACM, 34, 3 (1987), 596–615.CrossRefGoogle Scholar
  4. [4]
    Knuth, D.E., The Art of Computer Programming, Vol. 3: Sorting and Searching (Addison-Wesley, Reading, MA, 1973).Google Scholar
  5. [5]
    Navlakha, J.K., "Finding the k-th largest element in a large heap in O (k log log n) time", Proceedings of the 1982 Conference of Information Science and Systems, Princeton, (1982) 66–69.Google Scholar
  6. [6]
    Vuillemin, J., "A data structure for manipulating priority queues", Communications of the ACM, 21, (1978), 309–314.CrossRefGoogle Scholar
  7. [7]
    Williams, J. W. J., Algorithm 232, Communications of the ACM, 7, 6 (1964), 347–348.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1989

Authors and Affiliations

  • Mark Allen Weiss
    • 1
  • Jainendra K. Navlakha
    • 1
  1. 1.Florida International UniversityUniversity ParkMiami

Personalised recommendations