Yahoo Interview Question

Tree traversal, string manipulation