Theorem
Any sequence of m UNION/FIND operations, where m is ? (n) can be done in O(m log*n) time.
In theory, this is not linear, but in practice it is, since log*n ? 5 for values of n that come up in practice.
The UNION operations are done by rank.
FIND operations use path compression.