searchsort 0.1.0

A Rust trait implementing Binary Search and Quick Sort algorithms.
Documentation
  • Coverage
  • 75%
    3 out of 4 items documented1 out of 4 items with examples
  • Size
  • Source code size: 11.59 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.26 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • manorajesh/searchsort
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • manorajesh

SearchSort

A Rust trait implementing a Binary Search and the Quick Sort algorithm. Currently, they are implemented for Vec<T> types but can be expanded to other collection types.

Usage

cargo add searchsort

Examples

use searchsort::SearchSort;

let arr = vec![4, 82, 4, 32, 3, 20, 3, 2, 2, 9, 8, 7, 5, 0];
let find = 5;

assert_eq!(arr.find_me(find, 0, arr.len()-1), Some(12));

let mut arr = vec![3, 1, 4, 1, 5, 9, 2, 6, 5];
arr.quicksort();
assert_eq!(arr, [1, 1, 2, 3, 4, 5, 5, 6, 9]);

Why

This was my first time implementing the Binary Search and Quick Sort algorithms. I have a feeling this may not be the last time.