Find every single connected component in graph

Compute the connected components in linear time, using a simple for loop
and the BFS