Given a sorted linked list, delete all nodes
that have duplicate numbers, leaving onlydistinctnumbers from the original
list.For example,Given1->2->3-...
分类:
其他好文 时间:
2014-05-21 17:51:09
阅读次数:
190
【题目】
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
Each number in C may only be used once in the combination.
Note:
All numbers (including target) will be ...
分类:
其他好文 时间:
2014-05-21 15:55:25
阅读次数:
259
When you subtract two variables of type TIMESTAMP, you get an INTERVAL DAY TO SECOND which includes a number of milliseconds and/or microseconds depending on the platform. If the database is running o...
分类:
其他好文 时间:
2014-05-21 15:36:38
阅读次数:
488
There are two types of non-blocking thread synchronization algorithms
- lock-free, and wait-free. Their meaning is often confused. In lock-free systems, while any particular computation may be block...
分类:
其他好文 时间:
2014-05-21 10:27:20
阅读次数:
410
UVA 10712 - Count the Numbers
题目链接
题意:求区间[A,B]数字中,子串包含N的数字有多少个
思路:数位DP,写了个记忆化乱搞搞过了,dp[i][j][2][2][2],分别表示i位的时候,末尾为j的情况,后面3维用来处理小于的情况,已经出现过子串的情况,前导0的情况,然后注意特判一下数字0的情况,因为一开始要分解数字,而0是不能分解的。
代...
分类:
其他好文 时间:
2014-05-21 09:11:44
阅读次数:
264
题目:不用乘、除、取模运算来实现除法。
减法可以实现除法在是我们早就知道的,但是可能会出现问题,比如极端情况,a = 0x7FFFFFFF,b = 1,求a/b,这要减法运算多少次?
回想下我们开始学习计算机的时候,涉及到的进制之间的转换,就是给定你一个十进制数,写出他的二进制,刚开始的时候很傻,就按着书上的方法去不停的除以2,除以2,除以2,。。。可笑的是居然天真的算过1024的二进制,更可...
分类:
其他好文 时间:
2014-05-21 08:32:30
阅读次数:
191
ALTER TABLE
sql-statement ::=
ALTER TABLE [database-name .] table-name alteration
alteration ::=
RENAME TO new-table-name
alteration ::=
ADD [COLUMN] column-def
SQLite...
分类:
数据库 时间:
2014-05-21 08:10:45
阅读次数:
344
Installing in iOS (Xcode 5)
1:首先你要有一个项目。LOL
2:添加一个新的测试target。(关于Target是什么,请参考我的另外一篇文章)最新版Xcode 将Add Target放在顶部栏
3:选择新的target的类型
4:将GHUnit框架放到新建的target中
5:打开Objective-C categories,...
分类:
移动开发 时间:
2014-05-21 07:49:12
阅读次数:
399
题目:
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up t...
分类:
其他好文 时间:
2014-05-21 07:42:18
阅读次数:
230
远程库推送与克隆
1.Linux下产生ssh key
命令行输入 ssh-keygen -t rsa -C "your email"
则会在主目录下生成一个.ssh的目录,里面的id_rsa.pub为你ssh key密钥。
在登录github下,点击 account settings -> ssh key -> add ssh key 将你的key加入
此时,你就将这两个进行了一个绑...
分类:
系统相关 时间:
2014-05-21 06:28:30
阅读次数:
396