Algorithms | Graph Traversals | Question 12

Is following statement true/false?

A DFS of a directed graph always produces the same number of tree edges, i.e., independent of the order in which vertices are considered for DFS.
(Source http://courses.csail.mit.edu/6.006/oldquizzes/solutions/q2-f2008-sol.pdf)
(A) True
(B) False


Answer: (B)

Explanation: Consider the following graph. If we start from ‘a’, then there is one tree edge. If we start from ‘b’, then there is no tree edge.

a—->b

Quiz of this Question

My Personal Notes arrow_drop_up