Skip to content

Commit 649a2ec

Browse files
committed
floyd's algorithm
1 parent dd0109c commit 649a2ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

linkedlist/hascycle.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def hasCycle(n: Node) -> bool:
1414
break
1515

1616
if slow != fast: return None
17-
17+
18+
#floyd's algorithm
1819
start = n
1920
while start != slow:
2021
start = start.next

0 commit comments

Comments
 (0)