Skip to main content

Intersection of Linked Lists

Learn Intersection of Linked Lists (Linked List, Data Structures & Algorithms) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Finding Where Two Lists Merge Two singly linked lists that eventually MERGE into a shared tail (like a Y shape) - find the exact node where they intersect. The naive approach: HashSet all nodes of one list, then check each node of the other list for membership - O(n + m) time, O(n) space.

More lessons in Linked List