By lpasqualis
via codingaway.com
Published: Feb 06 2007 / 03:13
This article describes how to find out if a linked list has a loop. The presented "Turtle and Rabbit" algorithm uses two runners, a turtle and a rabbit, in a competition that ends only when the list is found to have or not have a loop.
Add your comment