Open In App

Algorithms | Graph Traversals | Question 8

Like Article
Like
Save
Share
Report

Given two vertices in a graph s and t, which of the two traversals (BFS and DFS) can be used to find if there is path from s to t?

(A)

Only BFS

(B)

Only DFS

(C)

Both BFS and DFS

(D)

Neither BFS nor DFS



Answer: (C)

Explanation:

We can use both traversals to find if there is a path from s to t.

Hence Option(C) is the correct answer.


Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads