Pergunta de entrevista da empresa NVIDIA

I was asked to write a function for Binary tree.