Can someone help in printing cycle in a graph

Revision en1, by aman_naughty, 2019-03-24 21:52:50

I want help please don't down-vote.

I want to print the cycle in an undirected graph. I know how to detect cycle in an undirected graph but can't determine how to find the vertices involved in the cycle. Here is the code to find cycle.

code

Can someone please tell me how to modify this so that I can get the vertices in the cycle as well.

I have seen geeksforgeeks article on printing all cycles but I can't understand it. Is there some simpler approach ?

Tags #dfs, #cycle, #graph theory, #beginner

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English aman_naughty 2019-03-24 21:52:50 968 Initial revision (published)