Amazon interview question

Binary trees