Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to ...
分类:
其他好文 时间:
2018-03-26 00:35:04
阅读次数:
157
写在前面 写在前面 断断续续刷20多道LeetCode上的题了,之所以从这道题尅是记录,是终于自己慢慢有思路了,不再参考一些discuss中的思路了,还有,终于一次通过编译,LeetCode虽然有括号匹配等,但是相对于编译器还是近乎是白板的,多加练习,戒掉对编译器的依赖。另外,为了方便迁移,大多使用 ...
分类:
其他好文 时间:
2018-03-24 18:34:40
阅读次数:
205
Reversing Linked List Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, give ...
分类:
其他好文 时间:
2018-03-22 00:28:24
阅读次数:
213
Given a singly linked list, determine if it is a palindrome. Follow up:Could you do it in O(n) time and O(1) space? 判断单链表是否是回文的 C++(25ms): ...
分类:
其他好文 时间:
2018-03-20 18:02:54
阅读次数:
137
1 String 基本的数据类型。 2 list 2.1 将元素放入一个list中 rpush mylist A rpush mylist B rpush mylist A 如果mylist本来是不存在的,这样的话,就会创建一个新的list,名字是mylist,它是一个linked list有三个元 ...
分类:
其他好文 时间:
2018-03-19 19:38:42
阅读次数:
157
分组 328. Odd Even Linked List 序号为奇数的在前,偶数的在后,每一半相对顺序不变。 725. Split Linked List in Parts 将链表分为大小差不超1的k组。 86. Partition List 将链表分为小于x的部分和大于等于x的部分, 删除 237 ...
分类:
其他好文 时间:
2018-03-15 11:16:41
阅读次数:
219
Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, ...
分类:
其他好文 时间:
2018-03-12 18:47:41
阅读次数:
159
链表归纳 一、题型 1、链表反转/翻转 "206 Reverse Linked List" "092 Reverse Linked List II" "061 Rotate List" 2、链表划分/重排 "086 Partition List" "143 Reorder List" 3、链表合并 ...
分类:
其他好文 时间:
2018-03-11 14:32:00
阅读次数:
175
[抄题]: 设计一种方式检查一个链表是否为回文链表。1->2->1 就是一个回文链表。 [暴力解法]: 时间分析: 空间分析: [思维问题]: [一句话思路]: [输入量]:空: 正常情况:特大:特小:程序里处理到的特殊情况:异常情况(不合法不合理的输入): [画图]: [一刷]: [二刷]: [三 ...
分类:
其他好文 时间:
2018-03-10 20:27:56
阅读次数:
232
[抄题]: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 -- ...
分类:
其他好文 时间:
2018-03-10 11:51:40
阅读次数:
172