Amazon interview question

Coding question (binary search tree)