Yelp interview question

A basic tree traversal algorithm question.