Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Given two vertices in a graph s and t, which ... Start Learning for Free
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
Correct answer is option 'C'. Can you explain this answer?
Most Upvoted Answer
Given two vertices in a graph s and t, which of the two traversals (BF...
We can use both traversals to find if there is a path from s to t.
Free Test
Community Answer
Given two vertices in a graph s and t, which of the two traversals (BF...
Explanation:

Both BFS and DFS can be used to find if there is a path from s to t in a graph:
- BFS (Breadth-First Search): BFS explores all the neighboring nodes of a vertex before moving on to the next level. By performing BFS from vertex s, we can check if vertex t is reachable from s. If t is discovered during the BFS traversal, then there exists a path from s to t.
- DFS (Depth-First Search): DFS explores as far as possible along each branch before backtracking. By performing DFS from vertex s, we can check if vertex t is reachable from s. If during the DFS traversal, we encounter vertex t, then there exists a path from s to t.
Both BFS and DFS are traversal algorithms that can be used to explore paths in a graph. Depending on the specific characteristics of the graph and the requirements of the problem, either BFS or DFS may be preferred for finding a path from s to t.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Question Description
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 BFSb)Only DFSc)Both BFS and DFSd)Neither BFS nor DFSCorrect answer is option 'C'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about 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 BFSb)Only DFSc)Both BFS and DFSd)Neither BFS nor DFSCorrect answer is option 'C'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for 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 BFSb)Only DFSc)Both BFS and DFSd)Neither BFS nor DFSCorrect answer is option 'C'. Can you explain this answer?.
Solutions for 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 BFSb)Only DFSc)Both BFS and DFSd)Neither BFS nor DFSCorrect answer is option 'C'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of 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 BFSb)Only DFSc)Both BFS and DFSd)Neither BFS nor DFSCorrect answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of 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 BFSb)Only DFSc)Both BFS and DFSd)Neither BFS nor DFSCorrect answer is option 'C'. Can you explain this answer?, a detailed solution for 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 BFSb)Only DFSc)Both BFS and DFSd)Neither BFS nor DFSCorrect answer is option 'C'. Can you explain this answer? has been provided alongside types of 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 BFSb)Only DFSc)Both BFS and DFSd)Neither BFS nor DFSCorrect answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice 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 BFSb)Only DFSc)Both BFS and DFSd)Neither BFS nor DFSCorrect answer is option 'C'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev