Pregunta de entrevista de Oracle

Solve the connected components of a graph algorithm question.