The title: How to determine whether two linked lists intersect

People draw: Alibaba New Retail Technology Quality Department

Refer to the answer:

O(n2)O(n^2)O(n2): Two layers traversal, can always find whether the intersection

O(n)O(n)O(n): traversal at one level. After traversing two linked lists, if the pointer of the last node of the two lists is the same, they will intersect. Otherwise, they will not intersect