Question: In which scenario would you prefer BFS over DFS?
Options:
Correct Answer: When you need the shortest path in an unweighted graph
Solution:
BFS is preferred for finding the shortest path in unweighted graphs because it explores all neighbors at the present depth before moving deeper.