Function sort_steps::bogo_sort

source ·
pub fn bogo_sort<T>(v: &[T]) -> impl Iterator<Item = Vec<T>>where
    T: PartialOrd + Clone,
Expand description

Sorts a slice of data using the bogo sort in O(n!).

Examples

let numbers = [2, 1, 3, 4];
println!("Bogo Sort Steps:");
for (i, v) in bogo_sort(&numbers).enumerate() {
    println!("#{:02}: {:?}", i, v);
}