You are on page 1of 15

Trees with Partial

Rebuilding
Search balanced trees
• To rebuild them
• Rebuilding the entire tree takes(n)

• use of partial rebuilding for balanced search trees


was rediscovered in a different context by
Andersson (1989b, 1990, 1999) and Galperin and
Rivest (1993)

How little information is


sufficient to rebalance the tree
Continued…

How little information is sufficient to rebalance


the tree ?

• Red-black trees still needed one bit per node


• total number of leaves as balancing information
because this is sufficient to detect when a leaf is
too low
• Set a height threshold c log n for some c
sufficiently large. If the leaf height is too large
then we need to rebalance
Scapegoat trees
Find the point of imbalance ( Scapegoat) either by
weight balanced / height balanced approach and start
fixing the tree
Weight Balanced trees
Scapegoat tree

Has logarithmic height; at all times, the height of the scapegoat tree does
not exceed
Insert operation
Before Insert

After Insert
n = q = 10
Scapegoat
Delete from a Scapegoat tree
n=q=10
n=9
n=8

n=7
n=6
n=q=10
n=5

n=4
5

6
6

6 5 7
8
5 7
Disclaimer
• These slides are not original and have been
prepared using various sources for teaching
purpose only
• References
• 8. Scapegoat Trees (opendatastructures.org)
• ScapeGoat Tree | Set 1 (Introduction and Insertion) –
GeeksforGeeks
• Scapegoat tree – Wikipedia
• Peter Brass. 2008. Advanced Data Structures (1st. ed.).
Cambridge University Press, USA.

You might also like