Question d’entretien chez Thoughtworks

Find intersection and cycle in a linked list.

Réponse à la question d'entretien

Utilisateur anonyme

10 sept. 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