IBM Interview Question

Find a loop in a linked list

Interview Answer

Anonymous

May 26, 2016

Put a flag on every visited node; if you encounter a node that has a flag, then you found a loop