Why not just return the first node? That is as random as any other node. Don
On Dec 27 2012, 5:01 am, naveen shukla <naveenshuklasweetdrea...@gmail.com> wrote: > Given a linked list of infinite length. Write a function to return a random > node. > > Constraints: > > 1 You can traverse a singly linked list only once. > 2 You can not use any extra space. > > Thanks in advance. --