employer cover photo
employer logo
employer logo

Amazon Lab126

Part of Amazon

Is this your company?

Amazon Lab126 Interview Question

c program to find loop in a linked list

Interview Answer

Anonymous

Jun 9, 2014

initialize 2 pointers slow and fast. Increment slow by 1 and fast by 2 and each time compare slow and fast. if slow == fast, then there is a loop.