D-Programming-Language/phobos — pull request #553 by WebDrake (2012-04-24 16:05:25+00:00)
Title: Rewrite of RandomSample to use Jeffrey Scott Vitter's Algorithm D.

This algorithm calculates a random sample of size n in O(n) time,
generating O(n) random variates, as opposed to the previously
implemented Algorithm S where both scale with the size of the
data being sampled.

Variable names in the implementation follow those in Vitter's
papers introducing the algorithm:

* Vitter, J. S. (1984) Faster methods for random sampling.
Commun. ACM 27(7): 703--718.

* Vitter, J. S. (1987) An efficient algorithm for sequential
random sampling. ACM Trans. Math. Softw. 13(1): 58--67.