Google interview question

Tree traversal question, bfs/dfs question