What is the difference between breadth-first search & depth-first search
Answers
Answered by
1
Answer:
Breadth- first search uses Queue to find the shortest path. Depth-first search uses Stack to find the shortest path. Breadth- first search is better when target is closer to Source.Breadth- first search is better when target is far from source.
Answered by
2
- BFS uses Queue to find the shortest path. DFS uses Stack to find the shortest path. BFS is better when target is closer to Source. DFS is better when target is far from source.
ur answer dear❤
Similar questions