Re:Reservoir Sampling
by petters on Thursday May 08, 2025 @10:53PM
(#43933399)
This also got me past one interview. I came up with k/n but now I think it's better to just generate a random float in [0, 1] and keep the k largest ones
[ Parent
| on HN ]
There are no comments on this comment yet.