my output is not giving correct i tried find the error help me please
Undirected graph cycle detection using DFS
Hi @sandeep021,
pls share ur code using ide.codingblocks.com inorder to find the problem in ur code.
@sandeep021, in ur add edge function,change
adjlist[u].push_back(v);
if(bidir) adjlist[u].push_back(u);
to
adjlist[u].push_back(v);
if(bidir) adjlist[v].push_back(u);
Ur code will work fine.
Hope dis resolves ur doubt.
thank you sir i would have never found it