How to detect loops in a linked list without using a data structure
Utilisateur anonyme
start a fast pointer and a slow pointer each traversing the list. if they ever point to the same place after the start, then they are both caught in the same loop.