{"id":16064412,"url":"https://github.com/regexident/sorting_networks","last_synced_at":"2025-04-05T09:20:50.290Z","repository":{"id":57667974,"uuid":"124775941","full_name":"regexident/sorting_networks","owner":"regexident","description":"An implementation of sorting networks in Rust.","archived":false,"fork":false,"pushed_at":"2018-03-11T16:28:40.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T23:31:32.693Z","etag":null,"topics":["batcher","bitonic-sort","odd-even","rust","sorting","sorting-network"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/regexident.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-11T16:28:20.000Z","updated_at":"2018-03-13T16:08:44.000Z","dependencies_parsed_at":"2022-09-07T17:34:24.828Z","dependency_job_id":null,"html_url":"https://github.com/regexident/sorting_networks","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/regexident%2Fsorting_networks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regexident%2Fsorting_networks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regexident%2Fsorting_networks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regexident%2Fsorting_networks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/regexident","download_url":"https://codeload.github.com/regexident/sorting_networks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247313029,"owners_count":20918556,"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":["batcher","bitonic-sort","odd-even","rust","sorting","sorting-network"],"created_at":"2024-10-09T05:07:20.022Z","updated_at":"2025-04-05T09:20:50.220Z","avatar_url":"https://github.com/regexident.png","language":"Rust","readme":"# sorting_networks\n\n[![Build Status](http://img.shields.io/travis/regexident/sorting_networks.svg?style=flat-square)](https://travis-ci.org/regexident/sorting_networks)\n[![Downloads](https://img.shields.io/crates/d/sorting_networks.svg?style=flat-square)](https://crates.io/crates/sorting_networks/)\n[![Version](https://img.shields.io/crates/v/sorting_networks.svg?style=flat-square)](https://crates.io/crates/sorting_networks/)\n[![License](https://img.shields.io/crates/l/sorting_networks.svg?style=flat-square)](https://crates.io/crates/sorting_networks/)\n\n## Synopsis\n\nAn implementation of [sorting networks](https://en.wikipedia.org/wiki/Sorting_network) in Rust.\n\n## Motivation\n\n\u003e In computer science, comparator networks are abstract devices built up of a fixed number of \"wires\", carrying values, and comparator modules that connect pairs of wires, swapping the values on the wires if they are not in a desired order. Such networks are typically designed to perform sorting on fixed numbers of values, in which case they are called sorting networks. ([Wikipedia](https://en.wikipedia.org/wiki/Sorting_network))\n\n`sorting_network` provided implementations of [Batcher's Odd-Even Merge-Sort](https://en.wikipedia.org/wiki/Batcher_odd%E2%80%93even_mergesort) for sequences of length `2`, `4`, `8`, `16`, `32`, `64`, `128` and `256`.\n\nExample of `SortingNetwork16`:\n\n![preview](preview.png)\n\n## Usage\n\n```rust\nlet mut items = vec![7, 6, 5, 4, 3, 2, 1, 0];\nlet network = SortingNetwork16::new();\nnetwork.sort(\u0026mut items[..]);\nassert_eq!(items, vec![0, 1, 2, 3, 4, 5, 6, 7]);\n```\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our [code of conduct](https://www.rust-lang.org/conduct.html),  \nand the process for submitting pull requests to us.\n\n## License\n\nThis project is licensed under the [**MPL-2.0**](https://www.tldrlegal.com/l/mpl-2.0) – see the [LICENSE.md](LICENSE.md) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregexident%2Fsorting_networks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fregexident%2Fsorting_networks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregexident%2Fsorting_networks/lists"}