Pergunta de entrevista da empresa Oracle

Binary tree and interviewer made something up.