This question may be old, but I couldn\'t think of an answer.
Say, there are two lists of different lengths, merging at a point; how do we know wher
int FindMergeNode(Node *headA, Node *headB) { Node *tempB=new Node; tempB=headB; while(headA->next!=NULL) { while(tempB->next!=NULL) { if(tempB==headA) return tempB->data; tempB=tempB->next; } headA=headA->next; tempB=headB; } return headA->data; }