{"id":25171678,"url":"https://github.com/basemax/depthfirstsearchjava","last_synced_at":"2025-07-29T03:34:07.211Z","repository":{"id":65685394,"uuid":"579925345","full_name":"BaseMax/DepthFirstSearchJava","owner":"BaseMax","description":"This is a Java implementation of the Depth-First-Search algorithm. It is a recursive algorithm that traverses a graph in a depthward motion and uses a stack to remember to get the next vertex to start a search, when a dead end occurs in any iteration.","archived":false,"fork":false,"pushed_at":"2023-02-03T17:43:13.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-19T06:32:16.061Z","etag":null,"topics":["data-structure","datastructure","depth-first-search","dfs","dfs-algorithm","dfs-java","ds","java","java-dfs"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-19T09:32:32.000Z","updated_at":"2024-01-14T15:21:07.000Z","dependencies_parsed_at":"2023-02-18T09:31:30.629Z","dependency_job_id":null,"html_url":"https://github.com/BaseMax/DepthFirstSearchJava","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BaseMax/DepthFirstSearchJava","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FDepthFirstSearchJava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FDepthFirstSearchJava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FDepthFirstSearchJava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FDepthFirstSearchJava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/DepthFirstSearchJava/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FDepthFirstSearchJava/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267622688,"owners_count":24117036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-structure","datastructure","depth-first-search","dfs","dfs-algorithm","dfs-java","ds","java","java-dfs"],"created_at":"2025-02-09T09:21:36.176Z","updated_at":"2025-07-29T03:34:07.190Z","avatar_url":"https://github.com/BaseMax.png","language":"Java","readme":"# Depth-First-Search Java\r\n\r\nThis is a Java implementation of the Depth-First-Search algorithm. It is a recursive algorithm that traverses a graph in a depthward motion and uses a stack to remember to get the next vertex to start a search, when a dead end occurs in any iteration.\r\n\r\n## Usage\r\n\r\nTo use this algorithm, you need to create a graph and add vertices and edges to it. Then, you need to create a DepthFirstSearch object and pass the graph to it. Finally, you can call the search method to get the result.\r\n\r\n## Example\r\n\r\n```java\r\nGraph theGraph = new Graph();\r\ntheGraph.addVertex('A'); // 0 (start for dfs)\r\ntheGraph.addVertex('B'); // 1\r\ntheGraph.addVertex('C'); // 2\r\ntheGraph.addVertex('D'); // 3\r\ntheGraph.addVertex('E'); // 4\r\n\r\ntheGraph.addEdge(0, 1); // AB\r\ntheGraph.addEdge(1, 2); // BC\r\ntheGraph.addEdge(0, 3); // AD\r\ntheGraph.addEdge(3, 4); // DE\r\n\r\nSystem.out.print(\"Visits: \");\r\ntheGraph.dfs(); // depth-first search\r\nSystem.out.println();\r\n```\r\n\r\nCopyright (c) 2022, Max Base\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fdepthfirstsearchjava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fdepthfirstsearchjava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fdepthfirstsearchjava/lists"}