Reservoir Sampling
← Back to Randomized & Probabilistic
An algorithm for randomly selecting k items from a stream of unknown length, ensuring each item has an equal probability of being selected. Used when data cannot fit in memory.
← Back to Randomized & Probabilistic
An algorithm for randomly selecting k items from a stream of unknown length, ensuring each item has an equal probability of being selected. Used when data cannot fit in memory.