摘要: 迭代 class Solution { public ListNode swapPairs(ListNode head) { ListNode dummyHead = new ListNode(-1, head); ListNode prev = dummyHead; ListNode cur = 阅读全文
posted @ 2021-12-16 16:08 振袖秋枫问红叶 阅读(44) 评论(0) 推荐(0)
摘要: 迭代 class Solution { public ListNode deleteDuplicates(ListNode head) { /** * 节点数小于2不用去重 */ if (head == null || head.next == null){ return head; } /** * 阅读全文
posted @ 2021-12-16 14:46 振袖秋枫问红叶 阅读(37) 评论(0) 推荐(0)