ya that's a better and simplified approach....but i was trying to clear rahul doubt's bcoz he was not moving the second pointer...i gave explanation for that --
Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad <http://gplus.to/amolsharma99> <http://twitter.com/amolsharma99><http://in.linkedin.com/pub/amol-sharma/21/79b/507><http://youtube.com/amolsharma99> On Sun, Nov 20, 2011 at 2:38 PM, kartik sachan <[email protected]>wrote: > @amol..we can simply break the loop where we find the slow and fast > pointer meeting,then its become a a problem of two link list having common > ending point and different staring point > and for detecting the extact point where loop began is two traverse both > the list and find its length lets say 'a' and 'b' now put 1st pointer at > start position of 1st link list and other pointer at distance of |a-b| from > second list ...now where both of them meet is the point where loop began. > > correct me if i am worng ... > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
