Skip to main content

The Complexity of Rebalancing a Binary Search Tree

  • Conference paper
  • First Online:
  • 443 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1738))

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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. 72

    MathSciNet  Google Scholar 

  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. 73

    Google Scholar 

  3. A. Andersson. Effcient Search Trees. PhD thesis, Department of Computer Science, Lund University, Sweden, 1990. 73, 73, 82

    Google Scholar 

  4. A. Andersson, C. Icking, R. Klein, and T. Ottmann. Binary search trees of almost optimal height. Acta Informatica, 28:165–178, 1990. 73

    Article  MATH  MathSciNet  Google 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. 73

    Google 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, 75

    Google Scholar 

  7. N. Blum and K. Mehlhorn. On the average number of rebalancing operations in weight-balanced trees. Theoretical Computer Science, 11:303–320, 1980. 72

    Article  MATH  MathSciNet  Google 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, 82

    Google Scholar 

  9. L. J. Guibas and R. Sedgewick. A Dichromatic Framework for Balanced Trees. In 19th FOCS, pages 8–21, 1978. 72

    Google Scholar 

  10. D. E. Knuth. Sorting and Searching, volume 3 of The Art of Computer Programming. Addison-Wesley, 1973. 74

    Google Scholar 

  11. T. Lai. Effcient Maintenance of Binary Search Trees. PhD thesis, Department of Computer Science, University of Waterloo, Canada., 1990. 73, 73

    Google 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. 73

    Google Scholar 

  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, 79

    Article  MATH  MathSciNet  Google Scholar 

  14. J. Nievergelt and E. M. Reingold. Binary search trees of bounded balance. SIAM J. on Computing, 2(1):33–43, 1973. 72

    Article  MATH  MathSciNet  Google Scholar 

  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. 74

    Article  MATH  MathSciNet  Google Scholar 

  16. R. E. Tarjan. Amortized computational complexity. SIAM J. on Algebraic and Discrete Methods, 6:306–318, 1985. 81

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics