Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For e...
分类:
其他好文 时间:
2015-03-18 06:26:57
阅读次数:
109
Given a singly linked list L: L0→L1→…→Ln-1→Ln,
reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…
You must do this in-place without altering the nodes’ values.
For example,
Given {1,2,3,4},...
分类:
其他好文 时间:
2015-03-17 23:51:32
阅读次数:
344
Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.思路:不能用额外空间,就用矩阵的第一行和第一列来标记这一行或这一列是否需要置0. 用两个bool量记录第一行和第一列是否需...
分类:
其他好文 时间:
2015-03-17 17:37:25
阅读次数:
149
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place wit...
分类:
其他好文 时间:
2015-03-17 15:49:28
阅读次数:
128
Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For exam...
分类:
其他好文 时间:
2015-03-16 22:44:06
阅读次数:
139
题目Given a binary tree, flatten it to a linked list in-place.For example,Given 1
/ 2 5
/ \ 3 4 6
The flattened tree should look like: 1
2
...
分类:
其他好文 时间:
2015-03-16 16:33:35
阅读次数:
121
Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra space?A s...
分类:
其他好文 时间:
2015-03-16 14:26:38
阅读次数:
105
Description Do not sincere non-interference。 Like that show, now starvae also take part in a show, but it take place between city A and B. Starv...
分类:
其他好文 时间:
2015-03-14 23:08:52
阅读次数:
188
Reverse Linked List II问题:Reverse a linked list from positionmton. Do it in-place and in one-pass.思路: 三行情书,用的飞起我的代码:public class Solution { public ...
分类:
其他好文 时间:
2015-03-14 13:42:54
阅读次数:
103
Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For exam...
分类:
其他好文 时间:
2015-03-13 23:31:34
阅读次数:
164