Grid problem are solved by both BFS and DFS. But which one is efficient to solve grid problem?
Both BFS and DFS have same time complexity O(V+E).So you can use any of them.
Grid problem are solved by both BFS and DFS. But which one is efficient to solve grid problem?
Both BFS and DFS have same time complexity O(V+E).So you can use any of them.