next up previous
Next: Up: Previous:

Analysis:

Union by Rank Only:

\(\Theta(m lg n)\)

m = #operations

n ($\leq$ m) = #MakeSet operations in m

Path Compression Only:

\(\Theta(f \log_{(1 + f/n)} n)\) if f $\geq$ n

\(\Theta(n \;+\; f \lg n)\) if f < n

n = #MakeSet operations

There are $\leq$ n-1 Unions

f = #FindSet operations


next up previous
Next: Up: Previous: