Intersection of Linked Lists

In some cases 2 linked list can intersect each other. In the following diagram, you see that 2 NULL terminated singly linked lists are intersected at the node 5. In this implementation, we will find in which node the 2 lists are intersecting each other. The function will return the node address. We will use the helper functions form the previous post which add nodes to the lists, print the lists etc... Function which finds the intersection: /* * link_list_intersect() * Finds the intersection node of 2 lists. */ struct node * link_list_intersect ( struct node *list1, struct node *list2) { struct node *long_list; struct node *short_list; int diff = 0 ; /* * Get the lengths of the lists. */ int len1 = list_lenght_get(list1); int len2 = list_lenght_get(list2); /* * Find which list is long and which list is short * and find the absolute lenght difference. */ if (len1 >= len2) { diff = l...