Amazon interview question

Binary trees, depth first search.