Implementation of few searching and sorting algorithms. This crate is currently WIP, and supports only few of them.
Searching algorithms to be implemented:
Sorting algorithms to be implemented:
Add this to your Cargo.toml
file:
toml
[dependencies]
search-sort = "0.2"
This code sorts the slice
and searches for elements in it:
```rust use search_sort::{search, sort};
let mut slice = [5, 1, 91, -45, 11, 5]; sort::quick(&mut slice); assert_eq!(slice, [-45, 1, 5, 5, 11, 91]);
asserteq!(Some(2), search::binaryfirst(&slice, &5)); asserteq!(None, search::binaryfirst(&slice, &42)); ```
This code is released under the MIT license. See the LICENSE.md file.