Skip to content

Commit 79fd8e3

Browse files
author
albinsabu2023
committed
all set
1 parent 3b5fadb commit 79fd8e3

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/main/java/com/thealgorithms/datastructures/lists/CreateAndDetectLoop.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ static void createLoop(Node head, int position1, int position2) {
5656
node2.next = node1;
5757
}
5858
}
59-
6059
// Method to detect a loop in the linked list
6160
/**
6261
* Detects the presence of a loop in the linked list.
@@ -77,7 +76,4 @@ static boolean detectLoop(Node head) {
7776
}
7877
return false;
7978
}
80-
}
81-
82-
83-
79+
}

src/test/java/com/thealgorithms/datastructures/lists/CreateAndDetectLoopTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,4 @@ void testCreateLoopNoChangeForNonExistentPositions() {
6868
// Ensure no loop was created
6969
assertFalse(CreateAndDetectLoop.detectLoop(head), "No loop should be created if positions are out of bounds.");
7070
}
71-
}
72-
71+
}

0 commit comments

Comments
 (0)