Sample without replacement means that you select a certain number of items from a collection items, and the selected item is never selected again.
A quick search gives the solution from the COLT package:
http://acs.lbl.gov/software/colt/api/cern/jet/random/sampling/RandomSampler.html
But why not just use collections.shuffle? Less memory efficient(you have to generate the a large integer array in order to shuffle it) but no extra dependency required!
Comments