Hii
@ Question 2 -
1. Just count the no of nodes in each link list lets say N1 and N2 are the
number of the nodes in first and second linklist respectively.
2. Now calculate the difference of the Nodes like as
p = {N1~N2)
3. Now take 2 pointers say P1 and P2.
4.
a. If N1 >N2 then put the pointer p1 at Pth Node from the starting of
the first list and the pointer P2 at the starting of the second list
b. If N2 >N1 then put the pointer p2 at the Pth node from the starting of
the second list and the pointer P1 at the starting of the first list.
5. Now Increase the pointer one by one and at every step check if P1 ==
P2 and when it will true ,it will be your intended node.
Please correct me if i am wrong
Thanks
--
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.