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
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:
Consider the DAG with shown below. Which of the following is not a topological ordering?
Let be a depth first search tree in an undirected graph . Vertices and are leaves of this tree . The degrees of both and in are at least . which one of the following statements is true?
Let and be two vertices in a undirected graph having distinct positive edge weights. Let be a partition of such that and . Consider the edge having the minimum weight amongst all those edges that have one vertex in and one vertex in . Let the weight of an edge denote the …
Let and be two vertices in a undirected graph having distinct positive edge weights. Let be a partition of such that and . Consider the edge having the minimum weight amongst all those edges that have one vertex in and one vertex in . The edge must definitely belong to:
Let be a directed graph with vertices. A path from to in is a sequence of vertices () such that for all in through . A simple path is a path in which no vertex appears more than once. Let be an array initialized as follows: …
Consider the following graph: Among the following sequences: abeghf abfehg abfhge afghbe Which are the depth-first traversals of the above graph?
Consider an undirected, unweighted graph . Let a breadth-first traversal of be done starting from a node . Let and be the lengths of the shortest paths from to and respectively in . If is visited before during the breadth-first traversal, which of the following statements is correct?
Let be an undirected graph. Consider a depth-first traversal of , and let be the resulting depth-first search tree. Let be a vertex in and let be the first new (unvisited) vertex visited after visiting in the traversal. Which of the following statement is always true?
The most appropriate matching for the following pairs is:
Which of the following statements is false?
