Cramer interview question

tree traversal