KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a single direction linked list without knowing its size. I want to get a random element in this list, and I just have one time chance to traverse the list. (I am not allowed to traverse twice or more) What’s the algorithm for this problem? Thanks!
Tags (comma-separated)
Save Edits
Cancel