2 releases
0.1.1 | Oct 21, 2022 |
---|---|
0.1.0 | Oct 21, 2022 |
#1896 in Algorithms
4KB
Rust Bubble-sort
This package is a copy of the infamous bubble-sort for learning purpose
A quick and non-optimized, cloning version of the bubble sort algorithm. Created as a showcase for publishing crates in the Rust Cookbook 2018
Credit to: Claus Matzinger
lib.rs
:
This is a non-optimized implementation of the [bubble sort] algorithm for the book Rust Cookbook by Packt. This implementation also clones the input vector.
Examples
let v = vec![2, 2, 10, 1, 5, 4, 3];
assert_eq!(bubble_sort(&v), vec![1, 2, 2, 3, 4, 5, 10]);