Amazon Interview Question

Binary Search Tree traversal problem