i dont understan if i look in the pic i attached then the length of the first list is 5 and the length of the second list is 6. what should i do now? if i traverse the long list 5,6 nodes i dont get to the red node. what am i missing?
On 1 מאי, 18:04, Bhupendra Dubey <bhupendra....@gmail.com> wrote: > start from head of both and as soon as one of the list is empty means you > hit null > start counting the remaining number of nodes in the other list till that > gets empty. > > Now the number obtained above is the difference in length of the two list > prior to the first common node (the red node). Now again traverse the > longer list corresponding to the above count and then start traversing the > other list .Stop when two nodes become equal. Home!:) > > On Tue, May 1, 2012 at 7:55 PM, רפי וינר <rafiwie...@gmail.com> wrote: > > you have two linked lists that some where combine in to one list. > > pic attached to illustrate > > [image: Inline image 1] > > you need to find where the two list collide. (in the pic the red node) > > > -- > > 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. > > -- > bhupendra dubey > > Untitled.png > 14Kהצגהורדה -- 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.