results for bfs and dfs