Runtime after improvements!
If implemented with Union-by-size and Path Compression:
- practically keeps the tree almost flat
- makes the operations work in $O(\lg^* N)$
$\lg^* N$ (read: Iterated logarithm of $N$) is the number of times one needs to apply $\lg$ to $N$ to get a value less than or equal to $1$.
In practice, one could think of it to be almost $O(1)$ since it exceeds $5$ only after it has reached $2^{65536}$.
Aside: The proof of the above running time is beyond the scope of this course. The Union-Find data structure was invented in 1964. The running time above was proved in 1973 (by Hopcroft and Ullman — see their paper).