Amazon interview question

Binary Search Tree traversal problem