Amazon interview question

Binary tree traversal