Possible Duplicate:
How would you pick a uniform random element in linked list with unknown length?
Suppose we want to randomized choose an element from linked list, but we don't know the length of the linked list.
Design an algorithm which takes as least as possible running time to randomized choose the element.