Amazon interview question

Write a code to traverse a tree without recursion.