#sorting #step

nightly sort-steps

Sort terms step by step

7 releases

0.2.4 Mar 27, 2023
0.2.3 Mar 27, 2023
0.2.0 Apr 20, 2022
0.1.0 Apr 20, 2022
0.0.0 Apr 20, 2022

#53 in #step

Download history 42/week @ 2024-07-26 3/week @ 2024-08-02 11/week @ 2024-09-27 1/week @ 2024-10-04

64 downloads per month
Used in sort-visual

MPL-2.0 license

30KB
577 lines

#[test]
fn sort_step_by_step() {
    let numbers = [5, 9, 3, 6, 8, 2, 1, 7, 4];
    println!("Bubble Sort Steps:");
    for (i, v) in bubble_sort(&numbers).enumerate() {
        println!("#{}: {:?}", i, v);
    }
    println!("Insertion Sort Steps:");
    for (i, v) in insertion_sort(&numbers).enumerate() {
        println!("#{}: {:?}", i, v);
    }
    println!("Pancake Sort Steps:");
    for (i, v) in pancake_sort(&numbers).enumerate() {
        println!("#{}: {:?}", i, v);
    }
}

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

Dependencies

~310KB