Open In App

Algorithms | Graph Traversals | Question 12

Like Article
Like
Save Article
Save
Share
Report issue
Report

Is the 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. 

(A)

True

(B)

False



Answer: (B)

Explanation:

The statement is false.

A Depth-First Search (DFS) of a directed graph can produce a different number of tree edges depending on the order in which vertices are considered for the DFS. The number of tree edges in a DFS tree depends on the specific traversal path taken during the DFS.

During a DFS, starting from a particular source vertex, the traversal explores the graph by visiting neighboring vertices in a systematic way. The order in which the neighboring vertices are visited impacts the formation of the DFS tree.

Hence (B) is the correct answer.


Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads