{"title":"Bottom-up rebalancing binary search trees by flipping a coin","authors":"Gerth Stølting Brodal","doi":"10.1016/j.tcs.2025.115543","DOIUrl":null,"url":null,"abstract":"<div><div>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 <span><math><mi>n</mi></math></span> 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 <span><math><mrow><mi>O</mi><mo>(</mo><msup><mi>lg</mi><mn>2</mn></msup><mi>n</mi><mo>)</mo></mrow></math></span> time, and the resulting trees have the same distribution as inserting a uniform random permutation of <span><math><mi>n</mi></math></span> elements 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.</div><div>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 <span><math><mrow><mi>O</mi><mo>(</mo><mn>1</mn><mo>)</mo></mrow></math></span> time, uses expected <span><math><mrow><mi>O</mi><mo>(</mo><mn>1</mn><mo>)</mo></mrow></math></span> 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 <span><math><mrow><mi>O</mi><mo>(</mo><mi>lg</mi><mi>n</mi><mo>)</mo></mrow></math></span>. On the negative side, we prove for both algorithms that there exist simple insertion sequences where the expected depth is <span><math><mrow><mstyle><mi>Ω</mi></mstyle><mo>(</mo><mi>n</mi><mo>)</mo></mrow></math></span>, i.e., the studied rebalancing schemes are <em>not</em> competitive with (most) other rebalancing schemes in the literature.</div></div>","PeriodicalId":49438,"journal":{"name":"Theoretical Computer Science","volume":"1055 ","pages":"Article 115543"},"PeriodicalIF":1.0000,"publicationDate":"2025-09-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Theoretical Computer Science","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0304397525004815","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
引用次数: 0
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 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 time, and the resulting trees have the same distribution as inserting a uniform random permutation of elements 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 time, uses expected 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 . On the negative side, we prove for both algorithms that there exist simple insertion sequences where the expected depth is , i.e., the studied rebalancing schemes are not competitive with (most) other rebalancing schemes in the literature.
期刊介绍:
Theoretical Computer Science is mathematical and abstract in spirit, but it derives its motivation from practical and everyday computation. Its aim is to understand the nature of computation and, as a consequence of this understanding, provide more efficient methodologies. All papers introducing or studying mathematical, logic and formal concepts and methods are welcome, provided that their motivation is clearly drawn from the field of computing.