Abstract
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.
Preview
Unable to display preview. Download preview PDF.
6. References
Atallah M.J, and Kosaraju S.R, "An Adversary Lower Bound For Sorting", Information Processing Letters", 13, 2 (1981), 55–57.
Floyd, R. and Rivest, R., "Expected Time Bounds for Selection", Communications of the ACM, 18, (1975), 165–172.
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.
Knuth, D.E., The Art of Computer Programming, Vol. 3: Sorting and Searching (Addison-Wesley, Reading, MA, 1973).
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.
Vuillemin, J., "A data structure for manipulating priority queues", Communications of the ACM, 21, (1978), 309–314.
Williams, J. W. J., Algorithm 232, Communications of the ACM, 7, 6 (1964), 347–348.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1989 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Weiss, M.A., Navlakha, J.K. (1989). The distribution of keys in a binary heap. In: Dehne, F., Sack, J.R., Santoro, N. (eds) Algorithms and Data Structures. WADS 1989. Lecture Notes in Computer Science, vol 382. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-51542-9_42
Download citation
DOI: https://doi.org/10.1007/3-540-51542-9_42
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-51542-5
Online ISBN: 978-3-540-48237-6
eBook Packages: Springer Book Archive