algorithmz 1.2.9

This is the corresponding implemenation of the python module of the same name.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use algorithmz::sorting::wiggle_sort;

#[test]
fn test_wiggle_sort_empty() {
    let result = wiggle_sort(&[]);
    assert!(matches!(result, Err(ref e) if e == "Cannot use wiggle sort on an empty input!"));
}
#[test]
fn test_wiggle_sort() {
    let result = wiggle_sort(&[3, 5, 2, 1, 6, 4]).unwrap();
    assert_eq!(result,[3, 5, 1, 6, 2, 4]);
}