Adobe Interview Question

Write code to traverse a tree