@@ -0,0 +1,1567 @@
+package data_structures.linked_lists;%0D%0A%0D%0A/*%0D%0A * Problem Statement:%0D%0A * Youre given the pointer to the head nodes of two linked lists that merge%0D%0A * together at some node. Find the node at which this merger happens. The two%0D%0A * head nodes will be different and neither will be NULL.%0D%0A * %0D%0A * %5BList #1%5D a---%3Eb---%3Ec%0D%0A * %09%09%09%09%09%09%5C%0D%0A * %09%09%09%09%09%09x---%3Ey---%3Ez---%3ENULL%0D%0A * %09%09%09%09%09%09/%0D%0A * %09%09%5BList #2%5D p---%3Eq%0D%0A * In the above figure, both list merges at node x.%0D%0A * %0D%0A * Input Format:%0D%0A * You have to complete the int FindMergeNode(Node* headA, Node* headB) method%0D%0A * which takes two arguments - the heads of the linked lists. You should NOT%0D%0A * read any input from stdin/console.%0D%0A * %0D%0A * Output Format:%0D%0A * Find the node at which both lists merge and return the data of that node. Do%0D%0A * NOT print anything to stdout/console.%0D%0A * %0D%0A * Sample Input: %0D%0A * 1%0D%0A * %09%5C%0D%0A * %09 2---%3E3---%3ENULL%0D%0A * %09/%0D%0A * 1%0D%0A * %0D%0A * %0D%0A * 1---%3E2%0D%0A * %09%09 %5C%0D%0A * %09%09  3---%3ENull%0D%0A * %09%09 /%0D%0A * %09%091%0D%0A * %0D%0A * Sample Output: %0D%0A * 2%0D%0A * 3%0D%0A */%0D%0Apublic class FindMergePointOfTwoLists %7B%0D%0A%0D%0A%09int FindMergeNode(Node headA, Node headB) %7B%0D%0A%0D%0A%09    Node runnerA;%0D%0A%09    Node runnerB = headB;%0D%0A%09    %0D%0A%09    int mergeData = 0;%0D%0A%09    %0D%0A%09    outerloop:%0D%0A%09    while (true) %7B %0D%0A%09        runnerA = headA;%0D%0A%09        while (runnerA != null) %7B%0D%0A%09            if (runnerA.next == runnerB.next) %7B%0D%0A%09                mergeData = runnerA.next.data;%0D%0A%09                break outerloop;%0D%0A%09            %7D else %7B%0D%0A%09                runnerA = runnerA.next;%0D%0A%09            %7D%0D%0A%09        %7D%0D%0A%09        runnerB = runnerB.next;%0D%0A%09    %7D%0D%0A%09    return mergeData;%0D%0A%09%7D%0D%0A%7D

Add FindMergePointOfTwoLists