Amazon Interview Question

tree traversal without recursion