Given heads of two linked lists. Find if the two linked lists intersect. Solution should not use extra memory.
Sigiloso
If 2 linked lists point to the same node, then by definition, all subsequent nodes MUST be the same. A linked list only has a single 'next' node, and that doesn't change depending on the previous node. for example: A) 1->2->3->4->5 B) 6->7->4->8 The above example is what you're talking about. And it can't exist. Node 4 cannot simultaneously point to both 5 and 8, it MUST point to a single next node (or even if it points to multiple next nodes, they must be the same for every linked list that contains 4)