What is Floyd's_cycle_finding_algorithm and where can it be used efficiently?
I am trying to understand Floyd's_cycle_finding_algorithm but the ex开发者_如何转开发planations seem abstract.Can someone help me in undertanding this and whats the basic use ?Does it mean it can be used to find if an array has duplicate elements ? And also java implementation ?
Wikipedia has a good entry on this: http://en.wikipedia.org/wiki/Cycle_detection, it's used for detecting cycles in linked data structures (typically linked lists).
精彩评论