Pergunta de entrevista da empresa Asymmetrik

Singly-linked list. Find any loops in O(1) space.

Resposta da entrevista

Sigiloso

9 de mai. de 2022

Use 2 pointers, one going faster than the other. If they ever point to the same node, there is a loop.