摘要:
迭代 class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode dummyHead = new ListNode(-1); ListNode head = dummyHead; ListNo 阅读全文
posted @ 2021-12-09 22:10
振袖秋枫问红叶
阅读(15)
评论(0)
推荐(0)
摘要:
迭代 class Solution { public ListNode oddEvenList(ListNode head) { if (head == null){ return head; } /** * 类似于《86. 分割链表》,奇数位置的节点不动,将偶数位置的节点全部放到最后面,原地完成 阅读全文
posted @ 2021-12-09 20:51
振袖秋枫问红叶
阅读(48)
评论(0)
推荐(0)
摘要:
迭代 class Solution { public ListNode partition(ListNode head, int x) { if (head == null){ return head; } ListNode dummyHead = new ListNode(-1); dummyHe 阅读全文
posted @ 2021-12-09 17:20
振袖秋枫问红叶
阅读(29)
评论(0)
推荐(0)
摘要:
迭代 class Solution { public ListNode reverseBetween(ListNode head, int left, int right) { if (left == right){ return head; } ListNode prev = null; List 阅读全文
posted @ 2021-12-09 14:28
振袖秋枫问红叶
阅读(47)
评论(0)
推荐(0)