The Complexity of Rebalancing a Binary Serach Tree

  • Authors:
  • Rolf Fagerberg

  • Affiliations:
  • -

  • Venue:
  • Proceedings of the 19th Conference on Foundations of Software Technology and Theoretical Computer Science
  • Year:
  • 1999

Quantified Score

Hi-index 0.00

Visualization

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.