dart_collection_sampler library

Library helps sample 1 (or N) items from collections

Classes

CollectionSampler
Samples collections [...]
DiceSampler
sampler that picks item from a List using die-roll results

Functions

reservoirSampling<T>(Iterable<T> items, int N, Random random) → List<T>
Picks N unique elements from an Iterable using reservoir sampling. should be O(N). [...]