Agoda Interview Question

Tree traversal