Asked about Trees, graphs and the rest

When would you use BFS rather than DFS?

An answer that works

When the question involves levels, or the shortest path in an unweighted graph, since BFS reaches nodes in order of distance. DFS suits paths, subtree properties and anything naturally recursive.

Reading an answer is not being able to give one. The section that teaches this is Trees, graphs and the rest, 16 hours of Data structures & algorithms.

Learn this properly