Pergunta de entrevista da empresa J.P. Morgan

How to find a loop in a linked list?

Resposta da entrevista

Sigiloso

31 de ago. de 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.