Honeywell Interview Question

Tree traversal algo