2 ms·
https://rosettacode.org/wiki/Cycle_detection https://rosettacode.org/wiki/Cycle_detection Cycle detection in (currently) 44 languages. Most (all?) use Brent's
by Jtsummers 4y ago
https://rosettacode.org/wiki/Cycle_detection https://rosettacode.org/wiki/Cycle_detection
Cycle detection in (currently) 44 languages. Most (all?) use Brent's algorithm. They're operating on an iterated function but converting most of these to detect cycles in a linked list would be straightforward.