Amazon interview question

Coding question about binary search trees.