skip to main content
article
Free access

Randomized binary search trees

Published: 01 March 1998 Publication History

Abstract

In this paper, we present randomized algorithms over binary search trees such that: (a) the insertion of a set of keys, in any fixed order, into an initially empty tree always produces a random binary search tree; (b) the deletion of any key from a random binary search tree results in a random binary search tree; (c) the random choices made by the algorithms are based upon the sizes of the subtrees of the tree; this implies that we can support accesses by rank without additional storage requirements or modification of the data structures; and (d) the cost of any elementary operation, measured as the number of visited nodes, is the same as the expected cost of its standard deterministic counterpart; hence, all search and update operations have guaranteed expected cost O(log n), but now irrespective of any assumption on the input distribution.

References

[1]
ADEL'SON-VEL'SKII, G., AND LANDIS, E. 1962. An algorithm for the organization of information. Dokl. Akad. Nauk SSSR 146, 2, 263-266. (English translation in Soviet Math. Doklay 3, 1259-1263.)
[2]
ALLEN, B., AND MUNRO, J. 1978. Self-organizing search trees. J. ACM 25, 4, 526-535.
[3]
ARAGON, C. R., AND SEIDEL, R. G. 1989. Randomized search trees. In Proceedings of the 30th Annual IEEE Symposium on Foundations of Computer Science (FOCS). IEEE, New York, pp. 540-545.
[4]
BAEZA-YATES, R. 1986. A trivial algorithm whose analysis isn't: A continuation. Tech. Rep. CS-86-67. Dept. of Computer Science, University of Waterloo, Waterloo, Ind.
[5]
CULBERSON, J. 1985. The effect of updates in binary search trees. In Proceedings of the 17th ACM Symposium on the Theory of Computing (STOC) (Providence, R.I., May 6-8). ACM, New York, pp. 205-212.
[6]
EPPINGER, J. L. 1983. An empirical study of insertion and deletion in binary search trees. Commun. ACM 26 9 (Sept.), 663-669.
[7]
FELLER, W. 1968. An Introduction to Probability Theory and its Applications, vol. I. Wiley, New York.
[8]
GONNET, G., OLIVIE, H., AND WOOD, D. 1983. Height-ratio-balanced trees. Comput. J. 26, 2 106-108.
[9]
GONNET, G. H., AND BAEZA-YATES, R. 1991. Handbook of Algorithms and Data Structures-In Pascal and C. 2nd ed. Addison-Wesley, Reading, Mass.
[10]
GUIBAS, L., AND SEDGEWICK, R. 1978. A dichromatic framework for balanced trees. In Proceedings of the 19th Annual IEEE Symposium on Foundations of Computer Science (FOCS) (Oct.). IEEE, New York, 8-21.
[11]
HIBBARD, T.N. 1962. Some combinatorial properties of certain trees with applications to searching and sorting. J. ACM 9, 1 (Jan.), 13-18.
[12]
JONASSEN, A., AND KNUTH, D. 1978. A trivial algorithm whose analysis isn't. J. Comput. Syst. Sci. 16, 3, 301-322.
[13]
KNOTT, G.D. 1975. Deletions in Binary Storage Trees. Ph.D dissertation. Computer Science Dept., Stanford University, Stanford, Calif.
[14]
KNUTH, D.E. 1973. The Art of Computer Programming: Sorting and Searching, vol. 3. Addison- Wesley, Reading, Mass.
[15]
KNUTH, D. 1977. Deletions that preserve randomness. IEEE Trans. Softw. Eng. 3, 351-359.
[16]
KOZEN, D.C. 1992. The Design and Analysis of Algorithms. Springer-Verlag, New York.
[17]
MAHMOUD, H.M. 1992. Evolution of Random Search Trees. Wiley Interscience, New York.
[18]
MARTfNEZ, C., AND MESSEGUER, X. 1990. Deletion algorithms for binary search trees. Tech. Rep. LSI-90-39. Dept. LSI, Univ. Polit6cnica Catalunya, Barcelona, Spain.
[19]
NIEVERGELT, J., AND REINGOLD, E. 1973. Binary search trees of bounded balance. SIAM J. Cornput. 2, 1, 33-43.
[20]
PUOH, W. 1990. Skip lists: A probabilistic alternative to balanced trees. Commun. ACM 33, 6 (June), 668-676.
[21]
RAGHAVAN, P., AND MOTWANI, R. 1995. Randomized Algorithms. Cambridge University Press, Cambridge, Mass.
[22]
ROURA, S., AND MARTfNEZ, C. 1996. Randomization of search trees by subtree size. In Proceedings of the 4th European Symposium on Algorithms (ESA), J. Dfaz and M. Serna, eds. Lecture Notes in Computer Science, vol. 1136. Springer-Verlag, New York, pp. 91-106.
[23]
SEDOEWICK, R. 1988. Algorithms, 2nd ed. Addison-Wesley, Reading, Mass.
[24]
SEDGEWICK, R., AND FLAJOLET, P. 1996. An Introduction to the Analysis of Algorithms. Addison- Wesley, Reading, Mass.
[25]
SEIDEL, R., AND ARAGON, C. 1996. Randomized search trees. Algorithmica 16, 464-497.
[26]
STEPHENSON, C.J. 1980. A method for constructing binary search trees by making insertions at the root. Int. J. Comput. Inf. Sci. 9 1.
[27]
VITTER, J. S., AND FLAJOLET, P. 1990. Average-case analysis of algorithms and data structures. In Handbook of Theoretical Computer Science, chap. 9, J. van Leeuwen, ed. North-Holland, Amsterdam, The Netherlands.

Cited By

View all
  • (2024)Autocatalytic Sets and Assembly Theory: A Toy Model PerspectiveEntropy10.3390/e2609080826:9(808)Online publication date: 22-Sep-2024
  • (2024)Identifying a Malicious Node in a UAV NetworkIEEE Transactions on Network and Service Management10.1109/TNSM.2023.330080921:1(1226-1240)Online publication date: 1-Feb-2024
  • (2024)SPRINKLER: A Multi-RPL Man-in-the-Middle Identification Scheme in IoT NetworksIEEE Transactions on Mobile Computing10.1109/TMC.2024.337089423:10(9971-9988)Online publication date: 1-Oct-2024
  • Show More Cited By

Recommendations

Reviews

Don Goelman

Random binary search trees are the subclass of binary search trees (BSTs) built using only random insertions. That is, there is the same probability for the inserted key to fall into any of the j intervals defined by the j-1 keys already present in the tree. In this paper, the authors define and analyze structures they call randomized binary search trees (RBSTs). RBSTs are those trees produced by the specific insertion and deletion algorithms presented in the paper. Since the authors prove that RBSTs are always random BSTs, they can apply results known to hold for random BSTs. In particular, the expected cost of searches and updates is O log n , where n is the size of the tree. The insertion algorithm, part of which includes an implementation of Stephenson's algorithm, is shown to preserve random BSTs. In fact, while the standard insertion algorithm of a random permutation of keys into an empty BST yields a random BST, the algorithm in this paper yields a random BST on a fixed permutation as well. The deletion algorithm presented here also preserves the random property, as well as any arbitrary sequence of insertions and deletions, starting from an initially empty tree. Some interesting related discussions center on performance analysis and implementation (including consideration of node sizes, given auxiliary fields that might be needed), set operations (difference, union, and intersection), and implications for self-adjusting strategies (keys sought frequently should be near the root). The algorithms are illustrated with good examples and pictorial traces. Besides standard proofs, the authors use a formal algebraic diagrammatic approach following Martinez and Messeguer, here adapted to randomized algorithms. These results are compared with related randomized structures: treaps and skiplists. Both the research community and practitioners selecting appropriate data structures will find this paper useful and interesting.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

Journal of the ACM  Volume 45, Issue 2
March 1998
164 pages
ISSN:0004-5411
EISSN:1557-735X
DOI:10.1145/274787
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 March 1998
Published in JACM Volume 45, Issue 2

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. balanced trees
  2. probabilistic algebraic specification
  3. randomized data structures
  4. search trees
  5. self-organizing data structures

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)253
  • Downloads (Last 6 weeks)42
Reflects downloads up to 03 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Autocatalytic Sets and Assembly Theory: A Toy Model PerspectiveEntropy10.3390/e2609080826:9(808)Online publication date: 22-Sep-2024
  • (2024)Identifying a Malicious Node in a UAV NetworkIEEE Transactions on Network and Service Management10.1109/TNSM.2023.330080921:1(1226-1240)Online publication date: 1-Feb-2024
  • (2024)SPRINKLER: A Multi-RPL Man-in-the-Middle Identification Scheme in IoT NetworksIEEE Transactions on Mobile Computing10.1109/TMC.2024.337089423:10(9971-9988)Online publication date: 1-Oct-2024
  • (2023)Zip-Zip Trees: Making Zip Trees More Balanced, Biased, Compact, or PersistentAlgorithms and Data Structures10.1007/978-3-031-38906-1_31(474-492)Online publication date: 31-Jul-2023
  • (2022)Automated Expected Amortised Cost Analysis of Probabilistic Data StructuresComputer Aided Verification10.1007/978-3-031-13188-2_4(70-91)Online publication date: 7-Aug-2022
  • (2021)Zip TreesACM Transactions on Algorithms10.1145/347683017:4(1-12)Online publication date: 4-Oct-2021
  • (2020)Generating Trees for ComparisonComputers10.3390/computers90200359:2(35)Online publication date: 29-Apr-2020
  • (2020)Verified Analysis of Random Binary Tree StructuresJournal of Automated Reasoning10.1007/s10817-020-09545-064:5(879-910)Online publication date: 1-Jun-2020
  • (2020)Concurrent Treaps and Impact of Locking ObjectsNew Generation Computing10.1007/s00354-019-00073-z38:1(187-212)Online publication date: 1-Mar-2020
  • (2019)Leveraging hardware TM in HaskellProceedings of the 24th Symposium on Principles and Practice of Parallel Programming10.1145/3293883.3295711(94-106)Online publication date: 16-Feb-2019
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy