solve dfs bfs