Description
An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all c...
分类:
Web程序 时间:
2015-04-23 09:43:08
阅读次数:
142
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 length.
时间复...
分类:
其他好文 时间:
2015-04-23 09:43:01
阅读次数:
196
jQuery EasyUI
.drag-item{
list-style-type:none;
display:block;
padding:5px;
border:1px solid #ccc;
margin:2px;
width:300px;
background:#fafafa;
}
#place-hold{
list...
分类:
其他好文 时间:
2015-04-23 09:36:54
阅读次数:
156
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 mat...
分类:
其他好文 时间:
2015-04-22 13:22:15
阅读次数:
95
插入排序插入排序(Insertion Sort)是一种简单直观的排序方法,插入排序在实现上,通常采用in-place排序(即只需要O(1)的额外空间的排序),因而在从后向前扫描的过程中,需要反复把已排序的元素逐步向后挪位,为新元素提供插入空间。算法描述一般来说,插入排序都采用in-place在数组上...
分类:
编程语言 时间:
2015-04-21 14:33:51
阅读次数:
119
其实这几道题在leetcode中都是比较容易的,但是如果刚开始不理解题意的话可能就会进入陷阱。
整数数组中的几个操作如下面所示,无非是怎样进行数组元素的的交换。
Remove Element
Given an array and a value, remove all instances of that value in place and return the new length...
分类:
编程语言 时间:
2015-04-21 09:38:00
阅读次数:
136
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 with...
分类:
其他好文 时间:
2015-04-20 22:45:16
阅读次数:
132
正在进行的项目中有这样的需求:定位获得当前经纬度,再用百度Place API使用经纬度查询周边信息。这里不需要显示地图,只需要定位。看似思路很顺畅,做起来却不容易。
iPhone的GPS定位(CLLocationManager)获得的经纬坐标是基于WGS-84坐标系(世界标准),Google地图使用的是GCJ-02坐标系(中国特色的火星坐标系),这就是为什么获得的经纬坐标在goo...
分类:
移动开发 时间:
2015-04-20 09:38:25
阅读次数:
204
题目:
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
提示:
Did you use extra space?
A straight forward solution using O(mn) space is probably a bad idea....
分类:
其他好文 时间:
2015-04-19 22:52:07
阅读次数:
166
题目描述Given a binary tree, flatten it to a linked list in-place.For example,
Given
The flattened tree should look like:
本题也是考察二叉树和指针操作的题目。题目要求将一棵二叉树拉平为一个链表 。链表通过树节点的右子树相连,且展开的顺序为原来树的前序遍历。实现思路:
若节点n存...
分类:
其他好文 时间:
2015-04-18 23:48:59
阅读次数:
213