Site navigation

Which traversal technique visits all the vertices of a graph without going back?

Question and options

Which traversal technique visits all the vertices of a graph without going back?
  1. Depth-First Search (DFS)
  2. Breadth-First Search (BFS)
  3. Inorder Traversal
  4. Preorder Traversal

Answer and explanation

Correct answer: B - Breadth-First Search (BFS)
BFS explores level by level from the source using a queue, without backtracking. DFS goes deep and backtracks. Inorder and preorder are tree traversals, not general graph searches.

Practice for these exams

  • CUSAT CAT M.Sc. Forensic Science

  • Uttarakhand Judicial Services

    Subject revision

Related question papers

Related exam syllabi

More solved explanations in Computer fundamentals