Skip to content

Commit 0813ba4

Browse files
authored
Update MiddleOfLinkedList.java
1 parent dad528b commit 0813ba4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ public static void printList(ListNode node) {
6969
}
7070

7171
public static void main(String[] args) {
72-
Solution sol = new Solution();
72+
// Create an instance of this class to access non-static methods
73+
MiddleOfLinkedList sol = new MiddleOfLinkedList();
7374

7475
// Input array for the linked list
7576
int[] values = {1, 2, 3, 4, 5}; // Odd-length list

0 commit comments

Comments
 (0)