摘要: Given a linked list, remove the n th node from the end of list and return its head. example: 节点定义: 思路一:使用两个指针,第一个指针先走n步,后面两个指针同时走,当第一个指针走到最后的时候,第二指针指的 阅读全文
posted @ 2019-12-08 20:21 Jonathan1 阅读(98) 评论(1) 推荐(0) 编辑
摘要: 解答: 定义节点: 思路:比较两个链表的头结点大小,小的节点加入新链表里面,最后剩余的一个链表全部加入新链表里面。 Attention:leetcode上面的链表头结点是存储值的。 阅读全文
posted @ 2019-12-08 19:57 Jonathan1 阅读(84) 评论(0) 推荐(0) 编辑