We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ec67a4 commit 31da636Copy full SHA for 31da636
src/main/java/by/andd3dfx/collections/LoopInLinkedList.java
@@ -27,21 +27,21 @@ public static boolean isPresent(Node head) {
27
28
while (true) {
29
fast = fast.next;
30
- if (fast == slow) {
31
- return true;
32
- }
33
if (fast == null) {
34
return false;
35
}
36
-
37
- slow = slow.next;
38
- fast = fast.next;
39
if (fast == slow) {
40
return true;
41
+
+ slow = slow.next;
+ fast = fast.next;
42
43
44
+ if (fast == slow) {
+ return true;
+ }
45
46
47
0 commit comments