Cycle Detection Doubt

Revision en1, by aman_naughty, 2019-03-23 19:34:13

Is this code to detect cycle in an undirected graph correct. I have run it on a few test cases and it seems good . Can someone from the community verify it.

code:

code
Tags #graph, #cycle, #dfs, #doubt

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English aman_naughty 2019-03-23 19:34:13 829 Initial revision (published)