Thanks. I got it... On Fri, Dec 2, 2011 at 12:30 PM, atul anand <atul.87fri...@gmail.com> wrote:
> simple way of understanding this algo is that , q is incremented twice > than p or you can say q is moving twice faster then p. > > consider a scenario where last_node-> = first_node. > > now q would complete 2 round of this single link before node p reaches > last_node . so when p reaches last_node , at that point of time q would > have reached last_node (hence completing this 2 circle). > > hope this will help you in understanding the idea. > > On Fri, Dec 2, 2011 at 12:14 PM, Vijay Khandar <vijaykhand...@gmail.com>wrote: > >> But how plz explain in detail.............. >> >> >> On Thu, Dec 1, 2011 at 8:14 PM, Karthikeyan V.B <kartmu...@gmail.com>wrote: >> >>> detects the loop in the linked list >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.