Skip to content

GATE CS Graph Traversals (BFS, DFS) questions

Practise Graph Traversals (BFS, DFS) questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

11 on this page
Official PYQ2008AlgorithmsGraph Traversals (BFS, DFS)MCQ · 1 mark
The Breadth First Search algorithm has been implemented using the queue data structure. One possible order of visiting the nodes of the following graph is:
Official PYQ2007AlgorithmsGraph Traversals (BFS, DFS)MCQ · 1 mark
Consider the DAG with V={1,2,3,4,5,6}V = \{1,2,3,4,5,6\} shown below. Which of the following is not a topological ordering?
Official PYQ2006AlgorithmsGraph Traversals (BFS, DFS)MCQ · 1 mark
Let TT be a depth first search tree in an undirected graph GG. Vertices uu and νν are leaves of this tree TT. The degrees of both uu and νν in GG are at least 22. which one of the following statements is true?
Official PYQ2005AlgorithmsGraph Traversals (BFS, DFS)MCQ · 1 mark
Let ss and tt be two vertices in a undirected graph G=(V,E)G=(V,E) having distinct positive edge weights. Let [X,Y][X,Y] be a partition of VV such that s∈Xs \in X and t∈Yt \in Y. Consider the edge ee having the minimum weight amongst all those edges that have one vertex in XX and one vertex in YY. Let the weight of an edge ee denote the …
Official PYQ2005AlgorithmsGraph Traversals (BFS, DFS)MCQ · 1 mark
Let ss and tt be two vertices in a undirected graph G=(V,E)G=(V,E) having distinct positive edge weights. Let [X,Y][X,Y] be a partition of VV such that s∈Xs \in X and t∈Yt \in Y. Consider the edge ee having the minimum weight amongst all those edges that have one vertex in XX and one vertex in YY. The edge ee must definitely belong to:
Official PYQ2003AlgorithmsGraph Traversals (BFS, DFS)MCQ · 1 mark
Let G=(V,E)G= (V,E) be a directed graph with nn vertices. A path from viv_i to vjv_j in GG is a sequence of vertices (vi,vi+1,…,vjv_{i},v_{i+1}, \dots , v_j) such that (vk,vk+1)∈E(v_k, v_{k+1}) \in E for all kk in ii through j−1j-1. A simple path is a path in which no vertex appears more than once. Let AA be an n×nn \times n array initialized as follows: …
Official PYQ2003AlgorithmsGraph Traversals (BFS, DFS)MCQ · 1 mark
Consider the following graph: Among the following sequences: abeghf abfehg abfhge afghbe Which are the depth-first traversals of the above graph?
Official PYQ2001AlgorithmsGraph Traversals (BFS, DFS)MCQ · 1 mark
Consider an undirected, unweighted graph GG. Let a breadth-first traversal of GG be done starting from a node rr. Let d(r,u)d(r,u) and d(r,v)d(r,v) be the lengths of the shortest paths from rr to uu and vv respectively in GG. If uu is visited before vv during the breadth-first traversal, which of the following statements is correct?
Official PYQ2000AlgorithmsGraph Traversals (BFS, DFS)MCQ · 1 mark
Let GG be an undirected graph. Consider a depth-first traversal of GG, and let TT be the resulting depth-first search tree. Let uu be a vertex in GG and let vv be the first new (unvisited) vertex visited after visiting uu in the traversal. Which of the following statement is always true?
Official PYQ2000AlgorithmsGraph Traversals (BFS, DFS)MCQ · 1 mark
The most appropriate matching for the following pairs X: depth first search1: heap Y: breadth first search2: queueZ: sorting3: stack\begin{array}{|l|l|}\hline \text{X: depth first search} & \text{1: heap } \\ \hline \text{Y: breadth first search} & \text{2: queue} \\ \hline \text{Z: sorting} & \text{3: stack} \\ \hline \end{array} is:
Official PYQ1994AlgorithmsGraph Traversals (BFS, DFS)MCQ · 1 mark
Which of the following statements is false?