Domanda di colloquio di J.P. Morgan

How to find a loop in a linked list?

Risposta di colloquio

Anonimo

31 ago 2020

Use two pointers a tortoise and a hare...move torotise by 1 and hare by 2. if these two meet somewhere there is a loop in the linked list.