LC - Floyds slow fast pointer
Detect Loop Recently I practice the topic for floyd’s fast slow pointer algorithm to detect loop. The basic problem is that there is a link list with cycle (that is each node only points to at most one node), we can detect it by walking a fast pointer (do two ->next per loop), and slow pointer (one ->next at a time). In this case, there is a loop if two pointers can meet each other. ...