How to detect loops in a linked list without using a data structure
Anonymous
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.
Check out your Company Bowl for anonymous work chats.