Efficiently selecting a set of random elements from a linked list
- by Matt Sheppard
Say I have a linked list of numbers of length N. N is very large and I don’t know in advance the exact value of N.
How can I most efficiently write a function that will return k completely random numbers from the list?