Amazon interview question

A question on binary tree.