-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolution018Test.java
More file actions
31 lines (26 loc) · 945 Bytes
/
Solution018Test.java
File metadata and controls
31 lines (26 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.portgas;
import org.junit.Test;
public class Solution018Test {
@Test
public void test() {
Solution018.ListNode node1 = new Solution018.ListNode(1);
Solution018.ListNode node2 = new Solution018.ListNode(2);
Solution018.ListNode node3 = new Solution018.ListNode(2);
Solution018.ListNode node4 = new Solution018.ListNode(3);
Solution018.ListNode node5 = new Solution018.ListNode(3);
Solution018.ListNode node6 = new Solution018.ListNode(5);
node1.next = node2;
node2.next = node3;
node3.next = node4;
node4.next = node5;
node5.next = node6;
Solution018.ListNode head = new Solution018().deleteDuplication(node1);
printList(head);
}
private void printList(Solution018.ListNode head) {
while (head != null) {
System.out.print(head.value + ",");
head = head.next;
}
}
}