Google Interview Question

Find the number of connected components in a Graph.

Interview Answer

Anonymous

Apr 13, 2011

Depth search. When this is finished, a component is found. Go to a vertex not visited so far. Repeat depth search.