Anonymous user
Sorting algorithms/Sleep sort: Difference between revisions
→{{header|Rust}}: slight simplification, eliminates an allocation
(→{{header|Rust}}: give the Rust version a main function and example output) |
(→{{header|Rust}}: slight simplification, eliminates an allocation) |
||
Line 1,169:
<lang rust>use std::thread;
fn sleepsort
let mut threads = Vec::new();
for n in nums {
Line 1,180:
fn main() {
▲ sleepsort(args().skip(1).map(|s| FromStr::from_str(&s).unwrap()).collect());
}</lang>
Output:
|