
How would you pick a uniform random element in linked list with unknown length? - polm23
https://stackoverflow.com/questions/9401375/how-would-you-pick-a-uniform-random-element-in-linked-list-with-unknown-length
======
bediger4000
Seems like a job for Reservoir Sampling:
[https://en.wikipedia.org/wiki/Reservoir_sampling](https://en.wikipedia.org/wiki/Reservoir_sampling)

