#sorting #bubble #cookbook #packt #x5ff #support

learn-rust-with-bubble-sort

A quick and non-optimized, cloning version of the bubble sort algorithm. Created as a showcase for publishing crates in the Rust Cookbook 2018

2 releases

0.1.1 Oct 21, 2022
0.1.0 Oct 21, 2022

#1484 in Algorithms

33 downloads per month

MIT license

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]);

No runtime deps