Union by Rank / Size — Interactive Visualization

parent[]
rank[]
Click Preset Trees then Union to watch a balanced merge.
n: 0
Mode: by rank
Components: 0
Unions: 0
Rank bumps: 0
node comparing roots winner (new parent) loser (becomes child)

Operation Log