Find connected components in a undirected graph

programming

Statement

Given a graph $G = (V,E)$ how can we find a mapping from it’s vertices $V$ to the connected components of $G$.

Solutions