Amazon interview question

Sorting - 1st Round Tree and Graphs - 2nd round