hint plx how to solve it
Intersection point sof two linkedlist
@sameeksha,
You have got 2 lists. say the heads are c1 and c2.
Get the size of the 2 linked linked lists say d1 and d2.
if (d1 > d2) {
while (d-- > 0) {
c1 = c1.next;
}
} else {
while (d++ < 0) {
c2 = c2.next;
}
}
After that just check for c1.data==c2.data in a while loop. If there is an answer return the value, else return null
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.