Abstract
For any function f, we give a rebalancing scheme for binary search trees which uses amortized O(f(n)) work per update while maintaining a height bounded by ⌈log(n + 1) + 1/f(n)⌉. This improves on previous algorithms for maintaining binary search trees of very small height, and matches an existing lower bound. The main implication is the exact characterization of the amortized cost of rebalancing binary search trees, seen as a function of the height bound maintained. We also show that in the semi-dynamic case, a height of ⌈log(n+1)⌉ can be maintained with amortized O(log n) work per insertion. This implies new results for TreeSort, and proves that it is optimal among all comparison based sorting algorithms for online sorting.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
G. M. Adel’son-Vel’skii and E. M. Landis. An Algorithm for the Organisation of Information. Dokl. Akad. Nauk SSSR, 146:263–266, 1962. In Russian. English translation in Soviet Math. Dokl., 3:1259-1263, 1962. 72
A. Andersson. Optimal bounds on the dictionary problem. In Proc. Symp. on Optimal Algorithms, Varna, volume 401 of LNCS, pages 106–114. Springer-Verlag, 1989. 73
A. Andersson. Effcient Search Trees. PhD thesis, Department of Computer Science, Lund University, Sweden, 1990. 73, 73, 82
A. Andersson, C. Icking, R. Klein, and T. Ottmann. Binary search trees of almost optimal height. Acta Informatica, 28:165–178, 1990. 73
A. Andersson and T. W. Lai. Fast updating of well-balanced trees. In SWAT’90, volume 447 of LNCS, pages 111–121. Springer-Verlag, 1990. 73
A. Andersson and T. W. Lai. Comparison-effcient and write-optimal searching and sorting. In ISA’91, volume 557 of LNCS, pages 273–282. Springer-Verlag, 1991. 73, 75
N. Blum and K. Mehlhorn. On the average number of rebalancing operations in weight-balanced trees. Theoretical Computer Science, 11:303–320, 1980. 72
R. Fagerberg. Binary search trees: How low can you go? In SWAT’ 96, volume 1097 of LNCS, pages 428–439. Springer-Verlag, 1996. 73, 73, 74, 82, 82
L. J. Guibas and R. Sedgewick. A Dichromatic Framework for Balanced Trees. In 19th FOCS, pages 8–21, 1978. 72
D. E. Knuth. Sorting and Searching, volume 3 of The Art of Computer Programming. Addison-Wesley, 1973. 74
T. Lai. Effcient Maintenance of Binary Search Trees. PhD thesis, Department of Computer Science, University of Waterloo, Canada., 1990. 73, 73
T. Lai and D. Wood. Updating almost complete trees or one level makes all the difference. In STACS’90, volume 415 of LNCS, pages 188–194. Springer-Verlag, 1990. 73
H. A. Maurer, T. Ottmann, and H.-W. Six. Implementing dictionaries using binary trees of very small height. Inf. Proc. Letters, 5:11–14, 1976. 73, 79
J. Nievergelt and E. M. Reingold. Binary search trees of bounded balance. SIAM J. on Computing, 2(1):33–43, 1973. 72
T. Ottmann, D. S. Parker, A. L. Rosenberg, H. W. Six, and D. Wood. Minimalcost brother trees. SIAM J. Computing, 13(1):197–217, 1984. 74
R. E. Tarjan. Amortized computational complexity. SIAM J. on Algebraic and Discrete Methods, 6:306–318, 1985. 81
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Fagerberg, R. (1999). The Complexity of Rebalancing a Binary Search Tree. In: Rangan, C.P., Raman, V., Ramanujam, R. (eds) Foundations of Software Technology and Theoretical Computer Science. FSTTCS 1999. Lecture Notes in Computer Science, vol 1738. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46691-6_6
Download citation
DOI: https://doi.org/10.1007/3-540-46691-6_6
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66836-7
Online ISBN: 978-3-540-46691-8
eBook Packages: Springer Book Archive