题目链接:https://leetcode.com/problems/design-linked-list/ Design your implementation of the linked list. You can choose to use the singly linked list or ...
分类:
其他好文 时间:
2018-11-20 16:29:03
阅读次数:
173
LeetCode 141 不花费额外的空间 方法很简单,遍历一遍即可,在遍历过的节点,都改变它的一个状态。如果形成环,会再次指向遍历过的节点,这个时候判断它的状态是否改变。 这个方法是可以被测试数据攻击掉的,不是完美解决方案。 ``` class Solution {public: bool has ...
分类:
其他好文 时间:
2018-11-20 15:14:20
阅读次数:
171
"LeetCode 142" 每遍历一个点,都要判断起点到这个点的距离,和启动点到这个点的next的距离。再比较一下就可以了。 ...
分类:
其他好文 时间:
2018-11-20 15:02:28
阅读次数:
111
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up:Can you ...
分类:
其他好文 时间:
2018-11-20 13:24:48
阅读次数:
127
Given a linked list, determine if it has a cycle in it. Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without usi ...
分类:
其他好文 时间:
2018-11-20 13:21:06
阅读次数:
195
Difficulty:medium Description Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the ...
分类:
其他好文 时间:
2018-11-19 11:11:39
阅读次数:
110
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list -- head = [4,5,1,9], wh ...
分类:
编程语言 时间:
2018-11-13 10:27:25
阅读次数:
152
题目链接:https://leetcode.com/problems/odd-even-linked-list/description/ Given a singly linked list, group all odd nodes together followed by the even nod ...
分类:
其他好文 时间:
2018-11-13 02:28:57
阅读次数:
163
题目链接:https://leetcode.com/problems/partition-list/description/ Given a linked list and a value x, partition it such that all nodes less than x come be ...
分类:
其他好文 时间:
2018-11-10 15:13:21
阅读次数:
189
A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key ...
分类:
其他好文 时间:
2018-11-05 19:13:32
阅读次数:
193