Let T be a depth first search tree in a undirected graph G Vertices u and v are leaves of this tree T. The degrees of both u and v in G are at least 2. Which one of the following statements is true?
GATE CSE · Algorithms
Master topic for Graph Traversal. Includes Breadth First Search (BFS), Depth First Search (DFS), Topological Sorting.
152 questions · 5 PYQs · 15 AI practice · GATE CSE 2027
Let T be a depth first search tree in a undirected graph G Vertices u and v are leaves of this tree T. The degrees of both u and v in G are at least 2. Which one of the following statements is true?
In a depth-first traversal of a graph G with n vertices, k edges are marked as tree edges. The number of connected components in G is
Consider the following graph Among the following sequences (I) a b e g h f (II) a b f e h g (III) a b f h g e (IV) a f g h b e Which are depth first traversals of the above graph?

Consider the undirected unweighted graph G. Let a breadth-first traversal of G be done starting from a node r . Let d(r,u) and d(r,v) be the lengths of the shortest paths form r to u and v respectively in G. If u is visited before v during the breadth-first traversal, which of the following statements is correct ?
Let G be an undirected graph. Consider a depth-first traversal of G, and let T be the resulting depth-first search tree. Let u be a vertex in G and let v be the first new (unvisited) vertex visited after visiting u in the traversal. Which of the following statement is always true?
In DFS, which of the following data structures is used implicitly when recursion is used?
What is the time complexity of DFS traversal using adjacency list representation for a graph with V vertices and E edges?
Which of the following properties is guaranteed by Depth First Search (DFS) traversal of a graph?
What is the minimum number of nodes in a Directed Acyclic Graph (DAG) that must have no incoming edges for a valid topological sort to exist?
In DFS, what is the maximum depth of recursion stack in worst case?
Which of the following statements is TRUE about topological sorting of a Directed Acyclic Graph (DAG)?
Consider a Directed Acyclic Graph (DAG) with 6 nodes. If the DAG has 5 edges, what is the MAXIMUM number of nodes that can have NO outgoing edges?
Select one or more correct options related to Kahn's algorithm for topological sorting.
DFS can be used to find strongly connected components using which algorithm?
In DFS, discovery time and finishing time are useful for:
Consider a connected undirected graph with V vertices. How many edges will be in the DFS tree?
A Depth First Search (DFS) based approach for topological sorting can be implemented by:
If DFS is implemented using adjacency matrix, what is its time complexity?
Consider BFS on a tree (connected acyclic graph) rooted at vertex with nodes. The BFS traversal order is the same as which tree traversal?
Which of the following applications are correctly associated with Depth First Search?
Want unlimited AI-generated Graph Traversal questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →