How do you decide just by looking whether to apply BFS or DFS ?

Specially in the 2d grid problems, what should be the best way to recognize whether to apply BFS or DFS ?

Comments (3)