Pergunta de entrevista da empresa Google

Island DFS question with binary trees.