Amazon Interview Question

Binary tree algorithm question.