Room for Improvement:Weighted Union
Always makes the root of the larger tree the new root
Often cuts down on height of the new up-tree
f
g
h
a
b
c
i
d
e
Could we do a
better job on this union?
Weighted union!
f
g
h
a
b
c
i
d
e
Previous slide
Next slide
Back to first slide
View graphic version