GATE | GATE CS Mock 2018 | Set 2 | Question 22

Which of following option is not correct regarding depth first searching?

(A) In a depth-first traversal of a graph G with V vertices, E edges are marked as tree edges. The number of connected components in G is (E – V).
(B) Depth-first search requires O(V^2) time if implemented with an adjacency matrix.
(C) Depth-first search requires O(V + E) time if implemented with adjacency lists
(D) None of these


Answer: (A)

Explanation: In a depth-first traversal of a graph G with V vertices, E edges are marked as tree edges. The number of connected components in G is (V – E).
Only option (A) is false.

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.