zameericle
June 21st, 2002, 09:07 AM
hello,
curious on the different algorithms available to detect loops in linked lists.
One algorithm I heard off was the "Tortouise & Hare" (sp??) where you have two pointers on the list, on of which moves twice as fast. Eventually the two pointers will meet up..
Are there any other algorithms?
thanks
Zameer
curious on the different algorithms available to detect loops in linked lists.
One algorithm I heard off was the "Tortouise & Hare" (sp??) where you have two pointers on the list, on of which moves twice as fast. Eventually the two pointers will meet up..
Are there any other algorithms?
thanks
Zameer