Pregunta de entrevista de Hammer

Not too difficult, but binary tree algorithms