Google interview question

Graphs and trees