Union-Find
0
1
2
3
4
5
6
7
Eight things, and nobody is connected to anybody — 8 separate groups. Each one points at itself, so each one is its own boss. The arrows you'll see are parent pointers: they *are* the data structure.
step 01/18
- just discovered
- moving
- visited
- visiting now
- ruled out