G T Let be a simple undirected graph, D be a DFS G T tree on , and B be the BFS tree on G. Consider the following statements. G
Statement I : No edge of is a cross with T respect to D (u, v) G u
Statement II : For every edge of , if is i v j T at depth and is at depth in B then |i − j| = 1 . In the light of the above statements, choose the correct answer from the options given below
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: C. Statement I is correct but Statement II is false
Explanation
In an undirected graph, DFS produces only tree and back edges — no cross edges (I true). In a BFS tree an edge's endpoints differ in depth by at most 1, and they can be at the same depth, so |i − j| = 1 is not always true (II false).
More Data Structures and Algorithms questions
- The weight of minimum spanning tree in graph G, calculated using Kruskal's algorithm is :
- What is the worst case running time of Insert and Extract-min, in an implementation of a priority queue using an unsorted array? Assume tha…
- In a B-Tree, each node represents a disk block. Suppose one block holds 8192 bytes. Each key uses 32 bytes. In a B-tree of order M there ar…
- Give tight bounds for T(n) = 4T(√n) + lg²n, with T(n) constant for n ≤ 2.
- Consider a weighted directed graph. The current shortest distance from source S to node x is represented by d[x]. Let d[v]= 29, d[u]= 15, w…
- When using Dijkstra's algorithm to find shortest path in a graph, which of the following statement is not true?