Amazon Interview Question

Binary trees