Please check code for Strongly connected components in a graph roblem
hello @sahilkhan2312000131
pls explain what u r trying in ur dfs function
check this , i havent verified ur logic only corrected some mistakes
in my dfs() function, I am checking that if after traversing all the neighbours, if I get back to the parent then this is one component and I should print this entire component. else remove this nbr from stack and also mark it as not visited because it can be part of some other component.
it is not giving any output
check now->
still i m not getting what u are trying
getting segmentation fault
do a dry run and see if it is working as per ur logic or not
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.