{"id":18024215,"url":"https://github.com/grayjack/algos","last_synced_at":"2025-03-27T00:30:53.224Z","repository":{"id":57482963,"uuid":"141784915","full_name":"GrayJack/algos","owner":"GrayJack","description":"A collection of algorithms in rust","archived":false,"fork":false,"pushed_at":"2021-03-11T21:45:55.000Z","size":61,"stargazers_count":17,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-22T18:11:22.085Z","etag":null,"topics":["algorithm","algorithms","rust","rust-crate","search","sort","sorting","string-match","string-matching"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/algos","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GrayJack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=RFC4CKATPS4US\u0026source=url","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=FBXMZU2NLJPUW\u0026source=url","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=2MQZLTXACP964\u0026source=url"]}},"created_at":"2018-07-21T05:47:10.000Z","updated_at":"2024-04-25T02:13:46.000Z","dependencies_parsed_at":"2022-08-27T20:02:43.438Z","dependency_job_id":null,"html_url":"https://github.com/GrayJack/algos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrayJack%2Falgos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrayJack%2Falgos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrayJack%2Falgos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrayJack%2Falgos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrayJack","download_url":"https://codeload.github.com/GrayJack/algos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245760584,"owners_count":20667886,"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":["algorithm","algorithms","rust","rust-crate","search","sort","sorting","string-match","string-matching"],"created_at":"2024-10-30T07:12:10.445Z","updated_at":"2025-03-27T00:30:52.942Z","avatar_url":"https://github.com/GrayJack.png","language":"Rust","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=RFC4CKATPS4US\u0026source=url","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=FBXMZU2NLJPUW\u0026source=url","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=2MQZLTXACP964\u0026source=url"],"categories":[],"sub_categories":[],"readme":"# **Algos**\n\n[![Crates.io](https://img.shields.io/crates/v/algos.svg)](https://crates.io/crates/algos)\n[![Documentation](https://docs.rs/algos/badge.svg)](https://docs.rs/algos)\n[![Build Status](https://github.com/GrayJack/algos/workflows/Build/badge.svg)](https://github.com/GrayJack/algos/actions)\n[![dependency status](https://deps.rs/repo/github/GrayJack/algos/status.svg)](https://deps.rs/repo/github/GrayJack/algos)\n[![GitHub license](https://img.shields.io/github/license/GrayJack/algos.svg)](https://github.com/GrayJack/algos/blob/master/LICENSE)\n\nA Rust library with a collection of algorithms. Mostly intended as learning exercises for Rust.\n\nOnly sort, search and pattern matching algorithms for now.\nIt is planned to add graph algorithms as well.\n\n## **Usage**\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nalgos = \"0.3\"\n```\n\nand this to your crate root if on 2015 edition:\n\n```rust\nextern crate algos;\n```\n\n### Sorts Algorithms\nAdd this to your crate root:\n\n```rust\nuse algos::sort;\n```\n\nand create an array and use like this:\n\n```rust\nfn fn main() {\n    let mut v = [2, 3, 1, 9, 8, 4];\n    // Crescent sorting\n    sort::heap(\u0026mut v, \u0026|a,b| a\u003cb);\n    // For decreasing sorting, change the signal in \u0026|a,b| a\u003eb.\n}\n```\n\nIt can also work in an array of Strings, sorting by the length of the string:\n\n```rust\nfn main() {\n    let mut v = [\"bc\", \"a\", \"def\", \"klmno\", \"ghij\", \"pqrstu\"];\n    // Crescent sorting\n    sort::merge(\u0026mut v, \u0026|a,b| a.len()\u003cb.len())\n}\n```\n\n### Search Algorithms\nAdd this to your crate root:\n\n```rust\nuse algos::search;\n```\n\nand create an array and use like this:\n\n```rust\nfn fn main() {\n    // Remember that your array must be crescent sorted.\n    let mut v = [1, 2, 3, 4, 5, 7, 9];\n\n    let find = search::binary(\u0026v, \u00265);\n}\n```\n\n### Pattern Matching algorithms\nAdd this to your crate root:\n\n```rust\nuse algos::pattern;\n```\n\nand use like this:\n\n```rust\nfn fn main() {\n    let p = \"ATCGGATTTCAGAAGCT\".as_bytes();\n    let find = karp_rabin(\u0026p, \u0026\"TTT\".as_bytes()); // Type Return\u003cusize, usize\u003e\n}\n```\n\n## **Implemented**\n### Sorts\n- [X] Selection Sort\n- [X] Bubble Sort\n- [X] Cocktail Sort\n- [X] Insertion Sort\n- [X] Merge Sort\n- [X] Quick Sort\n- [X] Heap Sort\n\n### Searches\n- [X] Linear Search\n- [X] Binary Search\n- [X] Exponential Search\n- [X] Fibonacci Search\n\n### String Matching\n- [X] Bruteforce\n- [X] Karp-Rabin\n- [ ] Boyer-Moore\n- [X] Horspool\n- [X] Quick\n- [ ] Two-Way\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrayjack%2Falgos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrayjack%2Falgos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrayjack%2Falgos/lists"}