In a social network analysis application, you need to find the shortest path between two users. Would DFS be an appropriate choice? Why or why not?

  • Both DFS and BFS
  • It depends on the specific network type
  • No
  • Yes
No, DFS is not an appropriate choice for finding the shortest path in a social network. DFS may find a path, but it may not be the shortest, as DFS explores one path deeply before backtracking. BFS, on the other hand, systematically explores all possible paths and ensures the shortest one is found.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *