Pregunta de entrevista de Yelp

A basic tree traversal algorithm question.