BFS and DFS changed (to_tree).