The key is to use two constant space(32 bits) to store how many times 1 or 0 showed up in the bit i. If times of 1 in bit i is not the multiple of 3, then the unique value's bit i is 1. Otherwise the ...
分类:
其他好文 时间:
2014-10-09 15:29:08
阅读次数:
243
You are given a grid of numbers. A snake sequence is made up of adjacent numbers such that for each number, the number on the right or the number belo...
分类:
其他好文 时间:
2014-10-09 14:15:14
阅读次数:
197
当用户触摸屏幕的时候,会产生许多手势,例如down,up,scroll,filing等等。 一般情况下,我们知道View类有个View.OnTouchListener内部接口,通过重写他的onTouch(View?v,?MotionEvent?event)方法,我们可以处...
分类:
其他好文 时间:
2014-10-09 13:46:19
阅读次数:
193
title
描述
Follow up for ”Remove Duplicates”: What if duplicates are allowed at most twice? For example, Given sorted array A = [1,1,1,2,2,3],
Your function should return length = 5, and A is no...
分类:
其他好文 时间:
2014-10-09 03:14:48
阅读次数:
163
归并排序可以有两种思路----top-down 和 bottom-up
top-down:
递归实现,将数组分成两半,分别处理;再合并。
伪代码如下:
split ( A[], l, r)
{
if ( r - l < 2) return;
m = (r + l) / 2;
split ( A, l, m); //split A[l…m-1]
split ( A, m, r); /...
分类:
其他好文 时间:
2014-10-09 02:51:37
阅读次数:
222
导入一个Maven项目之后发现有一个如下的错误:
Project configuration is not up-to-date with pom.xml. Run project configuration update
其实这个问题解决非常简单:
在项目上右键——【Maven】——【Update Project Configuration……】
这时会打开一...
分类:
其他好文 时间:
2014-10-08 18:05:35
阅读次数:
129
你可以通过模拟器的启动选项和控制台命令来控制模拟环境的行为和特性。一旦模拟器启动,你就可以通过键盘和鼠标来“按” 模拟器的按键,从而操作模拟器。下面的表格总结了模拟器按键可键盘按键之间的映射关系。模拟器按键 键盘按键后退ESC菜单F1或Page Up开始F2或Page Down呼叫F3挂断F4电源按...
分类:
移动开发 时间:
2014-10-08 12:45:05
阅读次数:
272
Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?使用快慢指针,如果有循环两指针必定能相遇: 1 p...
分类:
编程语言 时间:
2014-10-08 04:32:34
阅读次数:
298
1、Set Up a Recovery Catalog and Target DatabaseSetting up a recovery catalog is a very simple process. This can be done through the Enterprise Manager...
分类:
数据库 时间:
2014-10-08 02:35:54
阅读次数:
389
最简单的排序算法——冒泡排序: 1 void bubble_sort(int *arr, int len) 2 { 3 int up, down; 4 for(up = 0; up != len; ++ up) 5 { 6 for(down = 0; down != ...
分类:
其他好文 时间:
2014-10-07 23:58:24
阅读次数:
339