NetEase.com interview question

BFS and DFS