Reservoir sampling

Reservoir sampling

Reservoir sampling is a family of algorithms used to randomly select k items from a population of unknown size n. It requires only one pass over the population and does not require all n items to fit into main memory. The algorithm cannot look back at previous items, but must be able to extract a random sample without replacement at any point.

1 courses cover this concept

CS 168: The Modern Algorithmic Toolbox

Stanford University

Spring 2022

CS 168 provides a comprehensive introduction to modern algorithm concepts, covering hashing, dimension reduction, programming, gradient descent, and regression. It emphasizes both theoretical understanding and practical application, with each topic complemented by a mini-project. It's suitable for those who have taken CS107 and CS161.

No concepts data

+ 57 more concepts