mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-16 05:55:12 +00:00
[FEATURE] Add iterative DFS implementation for Graphs #111
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ybrenning on GitHub (Jan 22, 2022).
Detailed description
The Graph-DFS implementation in
dfs.cuses recursion, I would like to also add a function todfs.cwhich performs an iterative DFS.Context
I think it would make sense to also have a function in
dfs.cwith an iterative approach to depth-first search by using a simple stack data structure. I think it can make DFS easier to understand for some people and it's useful to demonstrate both iterative and recursive problem solving.Possible implementation
Use a simple stack data structure to store unvisited vertices as opposed to using the call stack.
Additional information
No response
@github-actions[bot] commented on GitHub (Feb 22, 2022):
This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@github-actions[bot] commented on GitHub (Mar 25, 2022):
This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@github-actions[bot] commented on GitHub (Apr 1, 2022):
Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!