Improving on the Basic Implementation
Typically, UNION and FIND operations are executed in sequences of about n/2 UNION operations and ?(n) FIND operations.
Therefore: Do a little extra work each time a UNION or FIND is performed, in order to reduce the work done in the future.