How can you efficiently detect whether two linked lists converged? If they do, how do you identify at which node this occurs?
Anonymous
The two single linked lists share the same suffix...but do not share the same prefix? Reverse both lists (dequeue, then enqueue onto a new head). Compare heads of both (reversed) lists until there is a mismatch.
Check out your Company Bowl for anonymous work chats.