Doutb in the code

will the same code also works in directed graphs?

@vgvg2242
yes it will work for directed graph, but there might be a possibility that you wont be able to visit all the nodes in the graph from particularvertex.

i think we first have to find root node also in case of directed graphs

yes…

1 Like

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.