Lakhankumawat / LearnCPP

Learn Cpp from Beginner to Advanced ✅ Practice 🎯 Code 💻 Repeat 🔁 One step solution for c++ beginners and cp enthusiasts.
https://lakhankumawat.github.io/LearnCPP/
MIT License
598 stars 484 forks source link

Add the code with In-depth explanation of Iterative DFS #1554

Closed AaliyahBeg closed 2 years ago

AaliyahBeg commented 2 years ago

Related Issue

Additional Info

Checklist

The Iterative Depth First Search way of traversal in Graphs is a popular graph traversal method used when the graph is nearly linear and has >=10^5 nodes .

If we use Recursive Depth First Search traversal then we will end up getting a stack overflow exception too quick. Thus this is used when Recursive Depth First Search traversal fails.

Output Screenshots

Screenshot #1 Screenshot #2
Input Output
Screen Shot 2022-05-29 at 11 03 44 PM Screen Shot 2022-05-29 at 10 59 32 PM
AaliyahBeg commented 2 years ago

Please review my PR @Lakhankumawat

github-actions[bot] commented 2 years ago

This PR is stale because it has been open 3 days with no activity. Please commit the changes requested or make improvements on the code. Thank you for your contributions!