Pregunta de entrevista de Accenture

Tree easy Problem can be solved using preorder