Domanda di colloquio di Amazon

Find cycle in link list

Risposta di colloquio

Anonimo

26 ott 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.