Pregunta de entrevista de Thoughtworks

Find intersection and cycle in a linked list.

Respuesta de la entrevista

Anónimo

10 sep 2021

For finding the intersection of the linked list, I gave 2 approaches. One was a naive approach with O(N^2) complexity and another by reversing both the linked list and finding the intersection. For finding cycle, I used Floyd's Cycle Finding Algorithm.

1