Reservoir sampling implementation.