public class TapeSampling<T> extends Object
N
to be known
before hand.
The algorithm produces random saamples without replacement and hence has O(1) extra
memory complexity
Implementation inspired from "JONES,T.G. A note on sampling a tape file"
(https://dl.acm.org/citation.cfm?id=368159)Constructor and Description |
---|
TapeSampling(Random rGen,
Iterator<T> input,
int N,
int k) |
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.