General Motors (GM) Interview Question

Tree traversal