PayPal Interview Question

Iterative traversal of tree