Question: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, ...
分类:
其他好文 时间:
2018-02-25 20:45:24
阅读次数:
226
Question: Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1- ...
分类:
其他好文 时间:
2018-02-25 13:11:44
阅读次数:
172
(1) 先找中点(2) 再reverse后半段(3) 不用管两个子linked list的长度是否相等,从各个子链表的头开始一个一个比较。值不相等就返回false,相等就继续移动。 ...
分类:
其他好文 时间:
2018-02-24 10:44:40
阅读次数:
155
https://leetcode.com/problems/remove-duplicates-from-sorted-list/description/Given a sorted linked list, delete all duplicates such that each element ... ...
分类:
其他好文 时间:
2018-02-23 10:58:50
阅读次数:
153
230,82,83 是一类题 time o(1) space o(1) ...
分类:
其他好文 时间:
2018-02-23 10:57:58
阅读次数:
132
https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/Given a linked list, remove the nth node from the end of list and return it... ...
分类:
其他好文 时间:
2018-02-22 11:00:42
阅读次数:
174
https://leetcode.com/problems/delete-node-in-a-linked-list/description/Write a function to delete a node (except the tail) in a singly linked list, gi... ...
分类:
其他好文 时间:
2018-02-22 00:40:31
阅读次数:
158
https://leetcode.com/problems/odd-even-linked-list/description/Given a singly linked list, group all odd nodes together followed by the even nodes. Pl... ...
分类:
其他好文 时间:
2018-02-21 23:58:28
阅读次数:
320
https://leetcode.com/problems/linked-list-cycle/description/ time: o(n) space: o(1) Follow up:Can you solve it without using extra space? if you use e ...
分类:
其他好文 时间:
2018-02-21 12:49:11
阅读次数:
175
Remove all elements from a linked list of integers that have value val. Example Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6 Return: 1 --> 2 ...
分类:
其他好文 时间:
2018-02-20 17:58:07
阅读次数:
162