Skip to content

Commit 20bda00

Browse files
refactor 23
1 parent d36ef43 commit 20bda00

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main/java/com/fishercoder/common/utils/CommonUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public static ListNode reverseList(ListNode head) {
147147

148148
public static void printList(final ListNode head) {
149149
ListNode temp = head;
150-
System.out.println("--------------------------------------------");
150+
System.out.println("\n--------------------------------------------");
151151
while (temp != null) {
152152
System.out.print(temp.val);
153153
temp = temp.next;

src/test/java/com/fishercoder/_23Test.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import org.junit.BeforeClass;
77
import org.junit.Test;
88

9+
import java.util.Arrays;
10+
911
public class _23Test {
1012
private static _23.Solution1 solution1;
1113
private static ListNode[] lists;
@@ -17,7 +19,10 @@ public static void setup() {
1719

1820
@Test
1921
public void test1() {
20-
lists = new ListNode[]{new ListNode(1), new ListNode(7), new ListNode(5)};
22+
ListNode head1 = ListNode.createSinglyLinkedList(Arrays.asList(1, 3, 5, 7, 11));
23+
ListNode head2 = ListNode.createSinglyLinkedList(Arrays.asList(2, 8, 12));
24+
ListNode head3 = ListNode.createSinglyLinkedList(Arrays.asList(4, 6, 9, 10));
25+
lists = new ListNode[]{head1, head2, head3};
2126
CommonUtils.printList(solution1.mergeKLists(lists));
2227
}
2328

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy