Computer Science, asked by HaseenaHamid, 4 months ago

What is the difference between breadth-first search & depth-first search

Answers

Answered by ronalsamaddar56
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 Anonymous
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

@iTzNightAngle

Similar questions