Adobe interview question

Write code to traverse a tree