one more bfs solution, and a dfs solution