Infosys interview question

Tree traversal implementation Cs subject question