Domanda di colloquio di Amazon

"code a program that checks if a linked list is circular"

Risposte di colloquio

Anonimo

6 feb 2016

tortoise and hare pointers

Anonimo

7 feb 2016

Just keep a head pointer at the start and traverse you own pointer through the Linked List until you find the head pointer or null. Shohuld the Linked list contains loops then tortoise and hare method will work.