Amazon Interview Question

Write a code to traverse a tree without recursion.