Question d’entretien chez Apple

How do you detect loops in linked list?

Réponse à la question d'entretien

Utilisateur anonyme

3 juin 2016

Using a fast and a slow pointer. A fast pointer jumps 2 nodes while a slow pointer jumps 1 node. If these pointer ever meet, then there is a loop in the linked list.

5