Pergunta de entrevista da empresa SIGNL

How do you tell if a node on a linked list leads back to itself

Resposta da entrevista

Sigiloso

17 de out. de 2013

Set a variable in each node as you reach it, and when you reach a new node check if the variable has already been set