Question DSA-GRAPH-0048
MediumHow can DFS detect a cycle in a directed graph?
- A.
By counting edges
- B.
By finding an edge to a vertex that is still on the recursion stack (a back edge)
- C.
Sign up free to see the answer and a step-by-step explanation.