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 on the path to point directly to the oldest ancestor, so next time you find the ancestor faster.
Before path compression: 1 -> 2 -> 3 -> 4 -> null After path compression: 1 -> 4 2 -> 4 3 -> 4 4 -> null
