Find Merge Point of Two Linked Lists
Write a c program to find merge point of two linked lists. You’re given the pointer to the head nodes of two linked lists that merge together at some node. Find the node at which this merger happens. The two head nodes will be different and neither will be NULL.
For Ex. the below lists merge at node element 2. Your program should return merge point element, so if below lists are given as a input then output should be 2.
c function to find Merge Point of Two Linked Lists
Find merge point of two linked lists
Node is defined as
int FindMergeNode(Node *headA, Node *headB)
int num = 0;
bool f = false;
tempB = headB;
if(tempB == headA)
num = headA->data;
f = true;
tempB = tempB->next;
headA = headA->next;
The above solution is less efficient. You can write an efficient solution and test your code at..