NVIDIA Interview Question

how to know if two linked list collide

Interview Answers

Anonymous

Mar 9, 2021

check if the last node is the same

3

Anonymous

Jul 25, 2021

Measure length of both lists (l). Promote the longer list to the difference between the lists. Now the lists are the same length. Compare each node while promoting. If any 2 nodes equal - lists intersect.

1