Amazon interview question

Two Sum and tree search.