题目:
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
思路:
题目的关键在in-place,否则就太容易了,为了达到in-place只能...
分类:
其他好文 时间:
2014-12-24 22:46:59
阅读次数:
138
【题目】
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:...
分类:
其他好文 时间:
2014-12-24 18:14:47
阅读次数:
119
Flatten Binary Tree to Linked ListGiven a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / ...
分类:
其他好文 时间:
2014-12-23 00:05:27
阅读次数:
202
题目Remove Duplicates from Sorted Array通过率31.9%难度EasyGiven a sorted array, remove the duplicates in place such that each element appear onlyonceand retu...
分类:
其他好文 时间:
2014-12-22 17:32:35
阅读次数:
165
这个题目没有动手实践,只是想了个思路,结果一看讨论区的代码瞬间感觉,我想的太复杂了。ps:有点想不明白,既然是要移除元素,为何不留下一个不含删除元素的纯净数组。
题目:
Given an array and a value, remove all instances of that value in place and return the new length.
The order of...
分类:
其他好文 时间:
2014-12-21 23:41:49
阅读次数:
390
题目:
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 w...
分类:
其他好文 时间:
2014-12-21 22:08:30
阅读次数:
178
In Modex, there are three tabs: Resoources, Elements & FilesFirst: 'Files' is the place where to put javascript, css & images. I also want to put font...
分类:
其他好文 时间:
2014-12-19 20:39:33
阅读次数:
162
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}, reorder it to ...
分类:
其他好文 时间:
2014-12-19 17:29:23
阅读次数:
232
标题:Remove Duplicates from Sorted Array通过率:31.9%难度简单Given a sorted array, remove the duplicates in place such that each element appear onlyonceand retu...
分类:
其他好文 时间:
2014-12-18 14:49:05
阅读次数:
175
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}, reorder it to ...
分类:
其他好文 时间:
2014-12-17 22:41:01
阅读次数:
243