Pergunta de entrevista da empresa Guidewire

How would you find out if a linked list contains a loop?

Resposta da entrevista

Sigiloso

30 de abr. de 2015

Have two iterators of the list, one moving two nodes each time, the other one node at a time. If they two instances are the same at any point, there is a loop.