Now, CONNECTED is constant time and we repeat it |E|
times.
JOIN is repeated |V|-1 times and can take up to |V|/2
time.
Too loose!
- Simple amortized analysis: Work is in relabeling nodes. How many
times can a node u be relabeled?
- Each time it is relabeled, it joins a set at least twice as big as
its old set. If it relabeled x times, what is the smallest set it
could possibly be in?
- The final set size is |V|, so how many times can a node be
relabeled?
Thus,
for all calls to JOIN.
Total: SORT plus JOIN is
.
Next: FAST UNION-FIND
Up: KRUSKAL'S ALGORITHM
Previous: Implementation