Skip to content

Commit a1c9d98

Browse files
committed
Update linked-list-cycle.cpp
1 parent 11522b2 commit a1c9d98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

C++/linked-list-cycle.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class Solution {
1616

1717
while (fast && fast->next) {
1818
slow = slow->next, fast = fast->next->next;
19-
if (slow == fast) {
19+
if (slow == fast) { // There is a cycle.
2020
return true;
2121
}
2222
}
23-
return false;
23+
return false; // No cycle.
2424
}
2525
};

0 commit comments

Comments
 (0)