ajay-dhangar / algo

This repository contains a collection of data structures and algorithms implemented in various programming languages. It is designed to help learners understand key concepts through hands-on examples. Contributions and improvements are welcome!
https://ajay-dhangar.github.io/algo/
MIT License
71 stars 234 forks source link

[Feature Request] <Depth-First Search (DFS) Algo> #512

Closed Gopal0Gupta closed 3 weeks ago

Gopal0Gupta commented 4 weeks ago

🚀 Feature Request

Is your feature request related to a problem? Please describe.

The existing algorithms available in the repository do not include Depth First Search (DFS), a fundamental graph traversal technique. Without DFS, users may face difficulties in implementing algorithms that rely on recursive exploration of nodes, such as solving mazes, analyzing networks, or finding connected components.

Describe the solution you'd like

I propose to add the DFS algorithm implemented in Java to the repository. This will help users perform recursive graph traversals, allowing them to explore all possible paths in a graph in-depth before backtracking.

Describe alternatives you've considered

I considered other traversal algorithms like Breadth First Search (BFS), which is already implemented. However, DFS offers a different approach that is more efficient in some use cases, such as navigating tree structures, detecting cycles, and implementing backtracking algorithms.

Additional context

The implementation will include test cases for both directed and undirected graphs. I can also provide an example of how DFS can be used to solve maze problems or detect cycles in a graph.


Would you like to work on this feature?

Gopal0Gupta commented 4 weeks ago

@ajay-dhangar please assign me this issue under hacktoberfest and gssoc extd.