Pregunta de entrevista de Google

The question was based on graph and binary trees.