Expand description
Reservoir sampling: collect a random sample of a known maximum size from an iterator of unknown length.
Implements Jeffrey Vitter’s Algorithm R (see https://en.wikipedia.org/wiki/Reservoir_sampling)
Functions§
- sample
- Return a random sample of a known maximum size from an iterator of unknown length.
- sample_
into - Collect a random sample of a known maximum size from an iterator of unknown length into an existing Vec.