Microsoft Interview Question

Find if a linked-list contains a cycle in constant space.

Interview Answer

Anonymous

Apr 18, 2012

This is a classic tortoise-and-hare algorithm (Floyd's cycle-detection algorithm).