Function pathfinding::directed::cycle_detection::brent
source · pub fn brent<T, FS>(start: T, successor: FS) -> (usize, T, usize)
Expand description
Identify a cycle in an infinite sequence using Brent’s algorithm. Return the cycle size, the first element, and the index of first element.
§Warning
If no cycle exist, this function loops forever.