sir my code is giving run time error pls let me know why??
and tell me mistake in my code
link is https://ide.codingblocks.com/s/112468
Connected components using dfs
@Tanna
Your algo implementation was correct. The only problem was with your function call. You are trying to call DFS with node 0 when there is no node with data 0.
Instead try calling it with
g.dfs(“jaipur”);
or
g.dfs(“delhi”);
or using some other node which is present in your graph.
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.