The Complexity of Rebalancing a Binary Search Tree

  • Rolf Fagerberg
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1738)


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.


Binary Tree Rebalancing Cost Binary Search Tree Unary Node Complete Binary Tree 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    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. 72MathSciNetGoogle Scholar
  2. 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. 3.
    A. Andersson. Effcient Search Trees. PhD thesis, Department of Computer Science, Lund University, Sweden, 1990. 73, 73, 82Google Scholar
  4. 4.
    A. Andersson, C. Icking, R. Klein, and T. Ottmann. Binary search trees of almost optimal height. Acta Informatica, 28:165–178, 1990. 73zbMATHCrossRefMathSciNetGoogle Scholar
  5. 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. 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
  7. 7.
    N. Blum and K. Mehlhorn. On the average number of rebalancing operations in weight-balanced trees. Theoretical Computer Science, 11:303–320, 1980. 72zbMATHCrossRefMathSciNetGoogle Scholar
  8. 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. 9.
    L. J. Guibas and R. Sedgewick. A Dichromatic Framework for Balanced Trees. In 19th FOCS, pages 8–21, 1978. 72Google Scholar
  10. 10.
    D. E. Knuth. Sorting and Searching, volume 3 of The Art of Computer Programming. Addison-Wesley, 1973. 74Google Scholar
  11. 11.
    T. Lai. Effcient Maintenance of Binary Search Trees. PhD thesis, Department of Computer Science, University of Waterloo, Canada., 1990. 73, 73Google Scholar
  12. 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
  13. 13.
    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, 79zbMATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    J. Nievergelt and E. M. Reingold. Binary search trees of bounded balance. SIAM J. on Computing, 2(1):33–43, 1973. 72zbMATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    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. 74zbMATHCrossRefMathSciNetGoogle Scholar
  16. 16.
    R. E. Tarjan. Amortized computational complexity. SIAM J. on Algebraic and Discrete Methods, 6:306–318, 1985. 81zbMATHCrossRefMathSciNetGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1999

Authors and Affiliations

  • Rolf Fagerberg
    • 1
  1. 1.BRICS, Department of Computer ScienceAarhus UniversityÅrhus CDenmark

Personalised recommendations