Amazon interview question

Some binary tree exercises