BFS and DFS done