Union-find represents each set with parent pointers. Find walks to a representative; union links two representatives.
Path compression connects visited nodes directly to the representative, shortening later lookups. Combined with union by size or rank, repeated operations are efficient.
When to use
Use it for connected components, grouping, and cycle checks while adding edges.