Floyd's cycle-finding algorithm

GPTKB entity

Statements (27)
Predicate Object
gptkbp:instanceOf gptkb:algorithm
gptkbp:alsoKnownAs gptkb:tortoise_and_hare_algorithm
gptkbp:category graph algorithms
pointer algorithms
gptkbp:complexity O(n)
gptkbp:cycleDetectedWhen tortoise and hare meet
gptkbp:field computer science
gptkbp:firstPublished 1967
gptkbp:hareSpeed moves two steps at a time
https://www.w3.org/2000/01/rdf-schema#label Floyd's cycle-finding algorithm
gptkbp:input linked list
sequence of values
gptkbp:inventedBy gptkb:Robert_W._Floyd
gptkbp:method uses two pointers
gptkbp:output location of cycle start
presence of a cycle
gptkbp:pointerNames turtle
hare
gptkbp:spaceComplexity O(1)
gptkbp:supportsAlgorithm gptkb:Brent's_cycle_detection_algorithm
gptkb:Pollard's_rho_algorithm
gptkbp:tortoiseSpeed moves one step at a time
gptkbp:usedFor cycle detection
detecting cycles in linked lists
finding cycles in a sequence
gptkbp:bfsParent gptkb:Robert_W._Floyd
gptkbp:bfsLayer 5