Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
167 tokens/sec
GPT-4o
7 tokens/sec
Gemini 2.5 Pro Pro
42 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Bottom-up Rebalancing Binary Search Trees by Flipping a Coin (2404.08287v1)

Published 12 Apr 2024 in cs.DS

Abstract: Rebalancing schemes for dynamic binary search trees are numerous in the literature, where the goal is to maintain trees of low height, either in the worst-case or expected sense. In this paper we study randomized rebalancing schemes for sequences of $n$ insertions into an initially empty binary search tree, under the assumption that a tree only stores the elements and the tree structure without any additional balance information. Seidel~(2009) presented a top-down randomized insertion algorithm, where insertions take expected $O\big(\lg2 n\big)$ time, and the resulting trees have the same distribution as inserting a uniform random permutation into a binary search tree without rebalancing. Seidel states as an open problem if a similar result can be achieved with bottom-up insertions. In this paper we fail to answer this question. We consider two simple canonical randomized bottom-up insertion algorithms on binary search trees, assuming that an insertion is given the position where to insert the next element. The subsequent rebalancing is performed bottom-up in expected $O(1)$ time, uses expected $O(1)$ random bits, performs at most two rotations, and the rotations appear with geometrically decreasing probability in the distance from the leaf. For some insertion sequences the expected depth of each node is proved to be $O(\lg n)$. On the negative side, we prove for both algorithms that there exist simple insertion sequences where the expected depth is $\Omega(n)$, i.e., the studied rebalancing schemes are \emph{not} competitive with (most) other rebalancing schemes in the literature.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (32)
  1. An algorithm for the organization of information. Proceedings of the USSR Academy of Sciences (in Russian), 146:263–266, 1962.
  2. The Design and Analysis of Computer Algorithms. Addison-Wesley, 1974.
  3. Concurrent treaps. In Shadi Ibrahim, Kim-Kwang Raymond Choo, Zheng Yan, and Witold Pedrycz, editors, Algorithms and Architectures for Parallel Processing - 17th International Conference, ICA3PP 2017, Helsinki, Finland, August 21-23, 2017, Proceedings, volume 10393 of Lecture Notes in Computer Science, pages 776–790. Springer, 2017. doi:10.1007/978-3-319-65482-9_63.
  4. Randomized splay trees: Theoretical and experimental results. Inf. Process. Lett., 81(4):213–221, 2002. doi:10.1016/S0020-0190(01)00230-7.
  5. Arne Andersson. Improving partial rebuilding by using simple balance criteria. In Frank K. H. A. Dehne, Jörg-Rüdiger Sack, and Nicola Santoro, editors, Algorithms and Data Structures, Workshop WADS ’89, Ottawa, Canada, August 17-19, 1989, Proceedings, volume 382 of Lecture Notes in Computer Science, pages 393–402. Springer, 1989. doi:10.1007/3-540-51542-9_33.
  6. Arne Andersson. General balanced trees. J. Algorithms, 30(1):1–18, 1999. doi:10.1006/JAGM.1998.0967.
  7. Balanced binary search trees. In Dinesh P. Mehta and Sartaj Sahni, editors, Handbook of Data Structures and Applications, chapter 10. Chapman and Hall/CRC, 2004. doi:10.1201/9781420035179.CH10.
  8. Randomized search trees. In 30th Annual Symposium on Foundations of Computer Science, Research Triangle Park, North Carolina, USA, 30 October - 1 November 1989, pages 540–545. IEEE Computer Society, 1989. doi:10.1109/SFCS.1989.63531.
  9. Fast set operations using treaps. In Gary L. Miller and Phillip B. Gibbons, editors, Proceedings of the Tenth Annual ACM Symposium on Parallel Algorithms and Architectures, SPAA ’98, Puerto Vallarta, Mexico, June 28 - July 2, 1998, pages 16–26. ACM, 1998. doi:10.1145/277651.277660.
  10. Andrew Donald Booth and Andrew J. T. Colin. On the efficiency of a new method of dictionary construction. Information and Control, 3(4):327–334, 1960. doi:10.1016/S0019-9958(60)90901-3.
  11. Gunnar Brinkmann and Jan Degraer anda Karel De Loof. Rehabilitation of an unloved child: semi-splaying. Software: Practice and Experience, 39(1):33–45, 2009. doi:10.1002/SPE.886.
  12. Gerth Stølting Brodal. Bottom-up rebalancing binary search trees by flipping a coin. In Andrei Z. Broder and Tami Tamir, editors, 12th International Conference on Fun with Algorithms (FUN 2024), June 4–8, 2024, Island of La Maddalena, Sardinia, Italy, volume 291 of LIPIcs, pages 25:1–25:15. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.FUN.2024.25.
  13. Mark R. Brown. A storage scheme for height-balanced trees. Information Processing Letters, 7(5):231–232, 1978. doi:10.1016/0020-0190(78)90005-4.
  14. Mark R. Brown. Addendum to “a storage scheme for height-balanced trees”. Information Processing Letters, 8(3):154–156, 1979. doi:10.1016/0020-0190(79)90009-7.
  15. Explaining the behaviour of binary search trees under prolonged updates: A model and simulations. Comput. J., 32(1):68–75, 1989. doi:10.1093/COMJNL/32.1.68.
  16. Analysis of the standard deletion algorithms in exact fit domain binary search trees. Algorithmica, 5(3):295–311, 1990. doi:10.1007/BF01840390.
  17. Concentration of Measure for the Analysis of Randomized Algorithms. Cambridge University Press, 2009.
  18. P. Erdős. On a lemma of Littlewood and Offord. Bulletin of the American Mathematical Society, 51(12):898 – 902, 1945. doi:10.1090/S0002-9904-1945-08454-7.
  19. Martin Fürer. Randomized splay trees. In Robert Endre Tarjan and Tandy J. Warnow, editors, Proceedings of the Tenth Annual ACM-SIAM Symposium on Discrete Algorithms, 17-19 January 1999, Baltimore, Maryland, USA, pages 903–904. ACM/SIAM, 1999. URL: https://dl.acm.org/doi/10.5555/314500.315079.
  20. Scapegoat trees. In Vijaya Ramachandran, editor, Proceedings of the Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, 25-27 January 1993, Austin, Texas, USA, pages 165–174. ACM/SIAM, 1993. URL: https://dl.acm.org/doi/10.5555/313559.313676.
  21. A dichromatic framework for balanced trees. In 19th Annual Symposium on Foundations of Computer Science, Ann Arbor, Michigan, USA, 16-18 October 1978, pages 8–21. IEEE Computer Society, 1978. doi:10.1109/SFCS.1978.3.
  22. Thomas N. Hibbard. Some combinatorial properties of certain trees with applications to searching and sorting. Journal of the ACM, 9(1):13–28, 1962. doi:10.1145/321105.321108.
  23. Donald Ervin Knuth. The art of computer programming, Volume III, 2nd Edition. Addison-Wesley, 1998.
  24. Randomized binary search trees. J. ACM, 45(2):288–323, 1998. doi:10.1145/274787.274812.
  25. Stephen J. Montgomery-Smith. The distribution of Rademacher sums. Proceedings of the American Mathematical Society, 109(2):517–522, 1990. doi:10.2307/2048015.
  26. Small ball probability, inverse theorems, and applications. In László Lovász, Imre Z. Ruzsa, and Vera T. Sós, editors, Erdős Centennial, pages 409–463. Springer Berlin Heidelberg, Berlin, Heidelberg, 2013. doi:10.1007/978-3-642-39286-3_16.
  27. Wolfgang Panny. Deletions in random binary search trees: A story of errors. Journal of Statistical Planning and Inference, 140(8):2335–2345, 2010. doi:10.1016/j.jspi.2010.01.028.
  28. Raimund Seidel. Maintaining ideally distributed random search trees without extra space. In Susanne Albers, Helmut Alt, and Stefan Näher, editors, Efficient Algorithms, Essays Dedicated to Kurt Mehlhorn on the Occasion of His 60th Birthday, volume 5760 of Lecture Notes in Computer Science, pages 134–142. Springer, 2009. doi:10.1007/978-3-642-03456-5_9.
  29. Randomized search trees. Algorithmica, 16(4/5):464–497, 1996. doi:10.1007/BF01940876.
  30. Self-adjusting binary search trees. Journal of the ACM, 32(3):652–686, 1985. doi:10.1145/3828.3835.
  31. J. W. J. Williams. Algorithm 232: Heapsort. Communications of the ACM, 7(6):347–348, 1964. doi:10.1145/512274.512284.
  32. P. F. Windley. Trees, forests and rearranging. The Computer Journal, 3(2):84–88, 1960. doi:10.1093/COMJNL/3.2.84.

Summary

We haven't generated a summary for this paper yet.

X Twitter Logo Streamline Icon: https://streamlinehq.com