Question d’entretien chez Amazon

Find cycle in link list

Réponse à la question d'entretien

Utilisateur anonyme

26 oct. 2011

Have to iterators, one that gets every item, and and one that gets every other. If iterator 1 == iterator2 before reaching end of list, then you have a cycle.