摘要: 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... 阅读全文
posted @ 2018-12-01 23:50 Mr.van_Gogh 阅读(717) 评论(0) 推荐(0) 编辑
摘要: 1 public class Main { 2 3 // 逆序打印链表 4 public void reversePrint(Node node) { 5 if (node == null){ 6 return; 7 } 8 reversePrint(node.next); 9 ... 阅读全文
posted @ 2018-12-01 22:54 Mr.van_Gogh 阅读(495) 评论(0) 推荐(0) 编辑
摘要: 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 ... 阅读全文
posted @ 2018-12-01 22:22 Mr.van_Gogh 阅读(3270) 评论(0) 推荐(0) 编辑