Pregunta de entrevista de Blume Global

Write an algorithm for traversing the tree.