i solved it using recursion
here is the code…
Node *intersectionOfTwoLinkedLists(Node *l1, Node *l2)
{
if(l1->next==NULL || l1==NULL)
return l1;
if(l2->next->next==NULL || l2==NULL)
return l2;
Node *n1=intersectionOfTwoLinkedLists(l1->next,l2);
Node *n2=intersectionOfTwoLinkedLists(l1,l2->next);
if(n1==n2)
return n1;
return NULL;
}
but dont know whats wrong with it