Pregunta de entrevista de TiVo

Island problem with DFS algorithm. We have to explain the algorithm and later write code and execute