Pergunta de entrevista da empresa Apple

Coding question on Binary Search Trees.