Not getting expected output

Please make the necessary changes in the code.

Hey @aatmictiwari19
what is the problem?

You forgot to add this edge
g.addEdges(3,0);

If this resolves your doubt then please mark it as resolved :slight_smile: