Pregunta de entrevista de Microsoft

question about tree traversal problem.