Problem:
Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be changed. It doesn't matter what you leave beyond the ne...
分类:
编程语言 时间:
2015-05-11 21:57:21
阅读次数:
167
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
...
分类:
其他好文 时间:
2015-05-11 14:54:35
阅读次数:
134
Rotate ImageYou are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?分析:rota...
分类:
其他好文 时间:
2015-05-11 14:41:11
阅读次数:
121
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
...
分类:
其他好文 时间:
2015-05-11 09:03:58
阅读次数:
107
今天安装了一下Xcode6-Beta版,想来体验一下Swift的魅力:安装Swift系统最低版本号为:10.9.3仅仅看看一点The Swift Programming Language,以下给大家分享一下:(待续。。。)// Playground - noun: a place where peo...
分类:
编程语言 时间:
2015-05-10 22:23:23
阅读次数:
181
用的是回溯法 1 class Solution { 2 public: 3 int INITIAL = -1000; 4 // 一维数组a[n]中,下标代表行号,对应里面存的值代表列号。比如a[2] = 4,说明2行4列(0行0列为最开始的行列号) 5 bool place(...
分类:
其他好文 时间:
2015-05-10 11:11:52
阅读次数:
121
转自:http://segmentfault.com/q/1010000002677808写的是移动端的web,定义了一个textarea,在placeholder中添加了一些提示语。由于有些手机屏幕不同,placeholder的内容不会自动换行,而是超出了屏幕显示区域。之前搜索过一些关于place...
分类:
其他好文 时间:
2015-05-09 17:22:36
阅读次数:
143
Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.相比...
分类:
其他好文 时间:
2015-05-08 12:40:15
阅读次数:
95
题目:
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 p...
分类:
其他好文 时间:
2015-05-07 14:40:29
阅读次数:
154
题目:
Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be changed. It doesn't matter what you leave beyond the new len...
分类:
其他好文 时间:
2015-05-07 14:37:47
阅读次数:
130