neeraj
unread,Sep 25, 2010, 2:55:39 PM9/25/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Programming Puzzles
hi manish,
for 1st by M position and 2nd by N position
first calculate LCM(M,N)=L(say) now these two pointers can only meet
at a*L for (a=1,2,3,4........)
these positions,
if the above two pointers at these (a*L ) positions at the same
time point to the same node then loop exist else not.
OBVIOUSLY, we continously monitor that node->next is valid or not..
-neeraj