摘要:
1 import java.util.HashSet; 2 import java.util.Set; 3 4 public class Main { 5 6 // 从无序链表中删除重复项 7 public Node removeDup(Node node) { 8 9 if (node == null || node.next == nu... 阅读全文
摘要:
1 public class Main { 2 3 // 逆序打印链表 4 public void reversePrint(Node node) { 5 if (node == null){ 6 return; 7 } 8 reversePrint(node.next); 9 ... 阅读全文
摘要:
1 public class Main { 2 3 // 就地逆序法 4 public Node reverse(Node head) { 5 // no need to reverse 6 if (head == null || head.next == null || head.next.next == null) { 7 ... 阅读全文