{"id":23470227,"url":"https://github.com/myronrotter/recap-java-algorithms","last_synced_at":"2026-05-16T22:04:32.194Z","repository":{"id":238198656,"uuid":"231753540","full_name":"myronrotter/recap-java-algorithms","owner":"myronrotter","description":"Recap and re-implement common-used and well-known algorithms in Java.","archived":false,"fork":false,"pushed_at":"2020-02-26T13:09:07.000Z","size":78,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T00:26:00.994Z","etag":null,"topics":["algorithms","java","java-8","searching-algorithms","sorting-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/myronrotter.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-04T11:43:01.000Z","updated_at":"2020-02-26T13:09:10.000Z","dependencies_parsed_at":"2024-05-04T22:38:58.549Z","dependency_job_id":null,"html_url":"https://github.com/myronrotter/recap-java-algorithms","commit_stats":null,"previous_names":["myronrotter/recap-java-algorithms"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/myronrotter/recap-java-algorithms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myronrotter%2Frecap-java-algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myronrotter%2Frecap-java-algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myronrotter%2Frecap-java-algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myronrotter%2Frecap-java-algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myronrotter","download_url":"https://codeload.github.com/myronrotter/recap-java-algorithms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myronrotter%2Frecap-java-algorithms/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266041696,"owners_count":23867944,"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","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","java","java-8","searching-algorithms","sorting-algorithms"],"created_at":"2024-12-24T15:50:31.919Z","updated_at":"2026-05-16T22:04:27.155Z","avatar_url":"https://github.com/myronrotter.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Recap java algorithms\n\nMain purpose of this project is to recap and re-implement common-used and well-known algorithms in Java and their properties as well as getting used to Maven, EditorConfig and GitHub actions/ workflows. Properties of implemented algorithms may differ from properties listed below. Some algorithms are plain implementations of common-known pseudocode.\n\n## Sorting\n\n| class        | name            | best-case            | average-case         | worst-case      | description                         | in-place                       | stable |\n| ------------ | --------------- | -------------------- | -------------------- | --------------- | ----------------------------------- | ------------------------------ | ------ |\n| insertion    | InsertionSort   | $\\Omega(n)$          | $\\Theta(n^2)$        | $O(n^2)$        |                                     | Yes                            | Yes    |\n|              | ShellSort[^1]   | $\\Omega(n * log(n))$ | $\\Theta(n * log(n))$ | $O(n^2)$        |                                     | Yes                            | No     |\n| selection    | SelectionSort   | $\\Omega(n^2)$        | $\\Theta(n^2)$        | $O(n^2)$        |                                     | Yes                            | No     |\n|              | HeapSort        | $\\Omega(n * log(n))$ | $\\Theta(n * log(n))$ | $O(n * log(n))$ |                                     | Yes                            | No     |\n| exchange     | BubbleSort      | $\\Omega(n)$          | $\\Theta(n^2)$        | $O(n^2)$        |                                     | Yes                            | Yes    |\n|              | CombSort[^1]    | $\\Omega(n * log(n))$ | $\\Theta(n^2/2^p)$    | $O(n^2)$        | $p$ the number of increments        | Yes                            | No     |\n|              | CocktailSort    | $\\Omega(n)$          | $\\Theta(n^2)$        | $O(n^2)$        |                                     | Yes                            | Yes    |\n|              | QuickSort       | $\\Omega(n * log(n))$ | $\\Theta(n * log(n))$ | $O(n^2)$        |                                     | Yes                            | No     |\n|              | GnomeSort       | $\\Omega(n)$          | $\\Theta(n^2)$        | $O(n^2)$        |                                     | Yes                            | Yes    |\n|              | BogoSort        | $\\Omega(n)$          | $\\Theta(n * n!)$     | $infinitly$     |                                     | Yes                            | No     |\n| merge        | MergeSort       | $\\Omega(n * log(n))$ | $\\Theta(n * log(n))$ | $O(n * log(n))$ |                                     | No (uses auxillary storage)    | Yes    |\n| distribution | CountingSort    | $\\Omega(n+k)$        | $\\Theta(n+k)$        | $O(n+k)$        | $k$ the range of the input interval | No (uses auxillary storage)    | Yes    |\n|              | BucketSort      | $\\Omega(n+b)$        | $\\Theta(n+b)$        | $O(n^2)$        | $b$ the number of buckets           | No (uses auxillary storage)    | No     |\n| concurrent   | BitonicSort[^2] | $\\Omega(log^2(n))$   | $\\Theta(log^2(n))$   | $O(log^2(n))$   |                                     | No (depends on implementation) | No     |\n| hybrid       |                 |                      |                      |                 |                                     |                                |        |\n| other        | PancakeSort     |                      | $\\Theta(n^2)$        | $O(n^2)$        |                                     | Yes                            | No     |\n\n## Searching\n\n| class               | name                          | best-case   | average-case              | worst-case    | description                        |\n| ------------------- | ----------------------------- | ----------- | ------------------------- | ------------- | ---------------------------------- |\n| generic (Searching) | LinearSearch                  | $\\Omega(1)$ | $\\Theta(n)$               | $O(n)$        |                                    |\n|                     | BinarySearch                  | $\\Omega(1)$ | $\\Theta(log(n))$          | $O(log(n))$   |                                    |\n|                     | TernarySearch                 | $\\Omega(1)$ | $\\Theta(log_3(n))$        | $O(log_3(n))$ |                                    |\n|                     | JumpSearch                    | $\\Omega(1)$ | $\\Theta(\\sqrt{n})$        | $O(\\sqrt{n})$ |                                    |\n|                     | ExponentialSearch             | $\\Omega(1)$ | $\\Theta(log(n))$          | $O(log(n))$   |                                    |\n|                     | FibonacciSearch               | $\\Omega(1)$ | $\\Theta(log(n))$          | $O(log(n))$   |                                    |\n| 2D (Searching2D)    | SaddlebackSearch              | $\\Omega(1)$ | $\\Theta(n+m)$             | $O(n+m)$      | $m$ the maximum of all rows length |\n| integer (Finding)   | InterpolationSearch           | $\\Omega(1)$ | $\\Theta(log(log(n)))$[^3] | $O(n)$        |                                    |\n|                     | InterpolationSequentialSearch |             |                           |               |                                    |\n\n[^1]: Strictly, it depends on gap sequence/ size.\n[^2]: Denoted is the delay within the network of $O(n * log^2(n))$ comparators.\n[^3]: E.g. the elements are uniformly distributed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyronrotter%2Frecap-java-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyronrotter%2Frecap-java-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyronrotter%2Frecap-java-algorithms/lists"}