Dfs to check the istree in graph


it gives me wrong answer
i make the cyle 0->6->8->9->0
but it gives me false plase check

Hey Deepak, your implementation is correct but you were not forming graph correctly
(no edge from 0 to 6!)
also this will give only cycle presence in component connected with 0.(To handle this just call istreehelp for every non visited node!)

thanks sir
for helping me

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.