Vidyalelo
Data Structure · Q10

Graphs

Programming · Data Structure · question 10

Q10

How can you determine if a graph contains a cycle using DFS?

A.
By checking if there is a back edge during traversal.
Answer
B.
By counting the number of vertices.
C.
By counting the number of edges.
D.
By checking if the graph is disconnected.

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board