Disjoint Sets
Disjoint Sets
𝑝 = 0,1 ≤ 𝑖 ≤ 𝑞.
Now let us process the following sequence of union-find
𝑝ሾ𝑖ሿ = −𝑐𝑜𝑢𝑛𝑡ሾ𝑖ሿ =
the following sequence of unions starting from
1,1 ≤ 𝑖 ≤ 𝑖 = 𝑛;
the initial configuration
1.
ۂ
… Example 1
• The use of collapsing rule roughly doubles the time for an individual
find. However it reduces the worst-case over a sequence of finds.