Sorting algorithms/Bogosort: Difference between revisions
Content added Content deleted
(→{{header|Rust}}: Shuffling is required so long as the list is NOT sorted.) |
|||
Line 2,357: | Line 2,357: | ||
{ |
{ |
||
let mut rng = rand::thread_rng(); |
let mut rng = rand::thread_rng(); |
||
while is_sorted_by(&order, coll) { |
while !is_sorted_by(&order, coll) { |
||
rng.shuffle(coll); |
rng.shuffle(coll); |
||
} |
} |