bfs & dfs are done