Amazon interview question

Find cycle in link list

Interview Answer

Anonymous

26 Oct 2011

Have to iterators, one that gets every item, and and one that gets every other. If iterator 1 == iterator2 before reaching end of list, then you have a cycle.