Mental Model
Path compression makes finding the group leader faster by flattening the tree structure during searches.
Analogy: Imagine a family tree where each person points to their parent. Path compression is like updating everyone in the chain to point directly to the oldest ancestor, so next time you find the ancestor quickly.
Before path compression: 1 -> 2 -> 3 -> 4 -> null After path compression: 1 -> 4 -> null 2 -> 4 -> null 3 -> 4 -> null 4 -> null
