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, רפי וינר <[email protected]> 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 [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.
>



-- 
bhupendra dubey

-- 
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.

<<Untitled.png>>

Reply via email to