Skip to content

Conversation

piyushkumar0707
Copy link
Contributor

Overview

This PR adds a comprehensive implementation of the Depth-First Search (DFS) algorithm, creating a new Graph Algorithms category for the repository.

Features

  • ✅ Both recursive and iterative implementations
  • ✅ Support for cyclic and acyclic graphs
  • ✅ Comprehensive documentation with time/space complexity
  • ✅ Extensive examples and test cases
  • ✅ Updated DIRECTORY.md

Why This Matters

Graph algorithms are fundamental in computer science but were completely missing from this repository. DFS is one of the most important graph traversal algorithms used in:

  • Cycle detection
  • Topological sorting
  • Connected components
  • Path finding

Testing

The implementation includes multiple test cases with different graph structures including cyclic graphs.

- Implement both recursive and iterative versions of DFS
- Include comprehensive documentation with time and space complexity
- Add extensive examples including cyclic graphs
- Create new graph_algorithms directory
- Update DIRECTORY.md to include the new algorithm
@Copilot Copilot AI review requested due to automatic review settings October 4, 2025 18:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new Depth-First Search (DFS) implementation (recursive and iterative) under a newly introduced Graph Algorithms section and updates DIRECTORY.md to reference it (along with several other added directory entries). Key changes:

  • Adds graph_algorithms/depth_first_search.r with recursive and iterative DFS plus inline demo code.
  • Updates DIRECTORY.md to include a new Graph Algorithms section and link to the DFS implementation.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
graph_algorithms/depth_first_search.r Introduces DFS (recursive + iterative) plus example executions.
DIRECTORY.md Adds Graph Algorithms section and entry for DFS (plus additional directory links).

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@siriak
Copy link
Member

siriak commented Oct 4, 2025

Please check the comments

@piyushkumar0707
Copy link
Contributor Author

@siriak sir i had resolved all conflicts now.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak merged commit b3d0b78 into TheAlgorithms:master Oct 5, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants