Pergunta de entrevista da empresa Two Sigma

2 graph questions (DFS, connected components)