One of n lines in a file: Difference between revisions

m
mNo edit summary
Line 1,912:
=={{header|Rust}}==
{{libheader|rand}}
You could also use `rand::seq::sample_iter` which uses thea more general version of this algorithmproblem, Reservoir Sampling: https://en.wikipedia.org/wiki/Reservoir_sampling.
<lang rust>extern crate rand;