[][src]Function mohan::fisher_yates

pub fn fisher_yates<T>(arr: &mut [T])

The in place Fisher-Yates shuffle. Based on [Fisher–Yates shuffle].

Examples

use mohan::fisher_yates;

// Collect the numbers 0..5
let mut a = (0..5).collect::<Vec<_>>();

// Permute the values in place with Fisher-Yates
fisher_yates(&mut a);