{"id":17723228,"url":"https://github.com/ohbus/algorithms","last_synced_at":"2026-03-27T04:21:24.398Z","repository":{"id":54176777,"uuid":"259855917","full_name":"ohbus/algorithms","owner":"ohbus","description":"Algorithms using Java built with Maven for testing using Junit","archived":false,"fork":false,"pushed_at":"2021-03-09T06:51:01.000Z","size":184,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-04T15:44:01.433Z","etag":null,"topics":["algorithms","collection","hacktoberfest","java","maven","snippets"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ohbus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-29T07:31:10.000Z","updated_at":"2021-11-20T12:37:16.000Z","dependencies_parsed_at":"2022-08-13T08:20:57.134Z","dependency_job_id":null,"html_url":"https://github.com/ohbus/algorithms","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/ohbus/algorithms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohbus%2Falgorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohbus%2Falgorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohbus%2Falgorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohbus%2Falgorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ohbus","download_url":"https://codeload.github.com/ohbus/algorithms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohbus%2Falgorithms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31018562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T03:51:26.850Z","status":"ssl_error","status_checked_at":"2026-03-27T03:51:09.693Z","response_time":164,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["algorithms","collection","hacktoberfest","java","maven","snippets"],"created_at":"2024-10-25T15:42:16.413Z","updated_at":"2026-03-27T04:21:24.320Z","avatar_url":"https://github.com/ohbus.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Algorithms\n\n![Algorithms CI](https://github.com/ohbus/Algorithms/workflows/Algorithms%20CI/badge.svg)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ohbus_algorithms\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=ohbus_algorithms)\n[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=ohbus_algorithms\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=ohbus_algorithms)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=ohbus_algorithms\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=ohbus_algorithms)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=ohbus_algorithms\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=ohbus_algorithms)\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=ohbus_algorithms\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=ohbus_algorithms)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n\n**Algorithms using Java built with :heart: using Maven**\n\n## [Contributing](https://github.com/ohbus/algorithms/blob/master/CONTRIBUTING.md)\n\nThis repository is contribution friendly. If you'd like to add or improve an algorithm, your contribution is welcome!\n\nPlease go through this comprehensive guide to setup the repository in your local enviornment using [this guide CONTRIBUTING.md](https://github.com/ohbus/algorithms/blob/master/CONTRIBUTING.md#contributing-to-algorithms).\n\nIf you're an algorithms enthusiast and want to add or improve an algorithm your contribution is welcome! Please be sure to include tests\n\n```zsh\n➜  algorithms git:(master) ./mvnw verify\n```\n### Adding a new algorithm\n#### The procedure to add a new algorithm or snippet of code is:\n\n1. If there doesn't already exist an issue, then file a new issue explaining the algorithm/change you want to do.\n2. Make sure the algorithm doesn't already exist! We don't want duplicate algorithms.\n3. Identify the category folder your algorithm belongs to. For example, a sorting snippet would belong to the `src/main/java/xyz/subho/algorithms/sort` folder. You may also create a new **category** folder if appropriate.\n4. Add the algorithm implementation to: `src/main/java/xyz/subho/algorithms/category/FooAlgorithm.java`\n5. Add tests for FooAlgorithm in: `src/test/java/xyz/subho/algorithms/category/FooAlgorithmTest.java`\n6. Test your algorithm thoroughly.\n7. Run **`./mvnw spotless:apply`** to format all Java code according to Google Style Guide.\n8. Send pull request for review.\n\n## Running an algorithm implementation\n\nTo compile and run any of the algorithms here, you need at least JDK version 11. Maven can make things more convenient for you, but it is not required.\n\n## Running with Maven (recommended)\n\nThis project supports the [Maven Wrapper](http://maven.apache.org/plugins/maven-wrapper-plugin/wrapper-mojo.html). The Maven wrapper automatically downloads dependecies at the first time it runs, so expect a delay when running the first command below.\n\nIf you are on Windows, use `mvnw` instead of `./mvnw` below.\n\nRun a single algorithm like this:\n\n```zsh\n./mvnw compile exec:java -Dexec.mainClass=\"\u003calgorithm-subpackage\u003e.\u003calgorithm-class\u003e\"\n```\n\nFor instance:\n\n```zsh\n./mvnw compile exec:java -Dexec.mainClass=\"xyz.subho.algorithms.sort.QuickSort\"\n```\n\n## Compiling and running with only a JDK\n\n### Create a classes folder\n\n```zsh\ncd algorithms\nmkdir classes\n```\n\n### Compile the algorithm\n\n```zsh\njavac -sourcepath src/main/java -d classes src/main/java/ \u003crelative-path-to-java-source-file\u003e\n```\n\n### Run the algorithm\n\n```zsh\njava -cp classes \u003cclass-fully-qualified-name\u003e\n```\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://subho.xyz\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/13291222?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSubhrodip Mohanta\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#projectManagement-ohbus\" title=\"Project Management\"\u003e📆\u003c/a\u003e \u003ca href=\"#maintenance-ohbus\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Souph\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/51859712?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSouptik Hari\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ohbus/algorithms/commits?author=Souph\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/deepsubha\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/35770307?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSUBHADEEP MAITI\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ohbus/algorithms/commits?author=deepsubha\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohbus%2Falgorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fohbus%2Falgorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohbus%2Falgorithms/lists"}