Amazon interview question

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

Interview Answers

Anonymous

6 Feb 2016

tortoise and hare pointers

Anonymous

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.