By Anirudh C V
We find the Node where the Two Linked Lists Merge in C++ by De-referencing any One Linked List and Iterating the other List
The merge point is where both lists point to the same node, i.e. they reference the same memory location. It is guaranteed that the two head nodes will be different, and neither will be NULL. After the merge point, both lists will share the same node pointers.
The findMergeNode returns the data value of the node where the lists merge.
The Time Complexity of this function is O(A+B) , where A is the number of nodes in list A and B is the number of nodes in modified list B.
Submitted by Anirudh C V (AnirudhCV)
Download packets of source code on Coders Packet
Comments