GATE CSE 2018 Q40: Cross edges in DFS tree and level differences in BFS tree
- Algorithms
- 2 marks
- MCQ
- −2/3 if wrong
Syllabus topic: Graph traversals, minimum spanning trees and shortest paths
Question
Let be a simple undirected graph. Let be a depth first search tree of . Let be a breadth first search tree of . Consider the following statements.
(I) No edge of is a cross edge with respect to . (A cross edge in is between two nodes neither of which is an ancestor of the other in .)
(II) For every edge of , if is at depth and is at depth in , then .
Which of the statements above must necessarily be true?
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: A (official GATE 2018 final answer key)
Concept used: In an undirected graph, DFS produces only tree and back edges; BFS guarantees the depths of the endpoints of any edge differ by at most 1 (possibly 0).
First step: For statement II, try a triangle: run BFS from one vertex and look at the depths of the two other vertices, which are joined by an edge.
Full step-by-step solution
Loading…
Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.
More questions on Graph traversals, minimum spanning trees and shortest paths
Every PYQ on this topic →Share this question
Source: official GATE 2018 CS question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key
More Algorithms PYQs
- 2026 Session 1 · Q17Solve nested recurrences T1 = 4T1(n/2) + T2, T2 = 5T2(n/4) + log n
- 2026 Session 1 · Q41Shortest paths with at most k edges: two statements
- 2026 Session 1 · Q47Condition forcing a vertex into every minimum vertex cover
- 2026 Session 1 · Q49Cycle and cut properties of MSTs with distinct weights
- 2026 Session 1 · Q50Impossible DFS discovery/finish orderings for a DAG edge
- 2026 Session 1 · Q55Properties of 2-colorable (bipartite) graphs