The Complexity of Rebalancing a Binary Search Tree
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.
KeywordsBinary Tree Rebalancing Cost Binary Search Tree Unary Node Complete Binary Tree
Unable to display preview. Download preview PDF.
- 2.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. 73Google Scholar
- 3.A. Andersson. Effcient Search Trees. PhD thesis, Department of Computer Science, Lund University, Sweden, 1990. 73, 73, 82Google Scholar
- 5.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. 73Google Scholar
- 6.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, 75Google Scholar
- 8.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, 82Google Scholar
- 9.L. J. Guibas and R. Sedgewick. A Dichromatic Framework for Balanced Trees. In 19th FOCS, pages 8–21, 1978. 72Google Scholar
- 10.D. E. Knuth. Sorting and Searching, volume 3 of The Art of Computer Programming. Addison-Wesley, 1973. 74Google Scholar
- 11.T. Lai. Effcient Maintenance of Binary Search Trees. PhD thesis, Department of Computer Science, University of Waterloo, Canada., 1990. 73, 73Google Scholar
- 12.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. 73Google Scholar