Union-find (disjoint sets)
Keep groups as trees; joining two groups points one root at the other, and finding flattens the path.
Unions0-1, 2-3, 4-5, 1-3, 5-6, 3-6, 0-6
8 separate sets: every node is its own root.
- compare
- swap or write
- settled
Space play · ← → step · Home End jump · drag the strip to scrub