Union-Find
Loading visualizer…
Initialize
0
01
12
23
34
45
56
67
70
1
2
3
4
5
6
7
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Union-Find
Loading visualizer…
Initialize
Union-Find
After find(x), every node on the walked path is re-pointed directly to the root. Tall chains flatten to stars in one pass.
Purple = find() with compression
…
Complexity
What does path compression do to the parent pointers after find(x)?