Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
分类:
其他好文 时间:
2014-07-07 23:02:31
阅读次数:
193
Problem Description:Given a binary tree, flatten it to a linked list in-place.Solution:对二叉树进行前序遍历(pre-order). 1 public void flatten(TreeNode root) { 2...
分类:
其他好文 时间:
2014-07-07 18:47:24
阅读次数:
306
Problem Description: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 no...
分类:
其他好文 时间:
2014-07-07 16:41:56
阅读次数:
141
You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?矩阵的旋转如1 2 34 5 67 8...
分类:
其他好文 时间:
2014-07-07 15:13:49
阅读次数:
181
datax <- read.csv("C:\\Users\\Jennifer\\Desktop\\place.csv",header=T,sep="\t")datay <- read.csv("C:\\Users\\Jennifer\\Desktop\\price.csv",header=T,sep...
分类:
其他好文 时间:
2014-07-03 11:23:12
阅读次数:
173
题目
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 lik...
分类:
其他好文 时间:
2014-06-30 18:13:31
阅读次数:
229
【题目】
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 {1,4,2,3}.
【题意】
给定一个链表L: L0→L1→…→Ln-1→Ln,对他重新排序成L...
分类:
其他好文 时间:
2014-06-30 10:11:14
阅读次数:
158
题目
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
Follow up:
Did you use extra space?
A straight forward solution using O(mn) space is probab...
分类:
其他好文 时间:
2014-06-30 06:17:09
阅读次数:
245
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...
分类:
其他好文 时间:
2014-06-28 09:55:50
阅读次数:
205
Given an array and a value, remove all instances of that value in place and return the new length.
分类:
其他好文 时间:
2014-06-27 12:17:58
阅读次数:
156