Theorem Again
The running time of m UNION and FIND operations is
The total of American pennies is O(m G(n)).
The total of Canadian pennies is O( n ? 1) = O(n G(n)).
Grand total is O(n log* n).
(Proof adapted from Weiss: Data Structures and Analysis in C, Benjamin Cummings, 1993).