Google interview question

Compare two trees using a depth first search.