find
operation) instead.
Hint: where in the proof do we use that we apply path compression and how is that knowledge used?
union
, then
all operations can be shown to be amortized O(log n).
Use for instance a potential function where the potential is the
sum of potentials associated with each node, and each node x has
a potential proportional to the logarithm of the size of the tree
rooted by x.
In the analysis of find
, it can be useful to divide
the nodes up into two groups with different properties.