Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:
其他好文 时间:
2014-06-25 23:01:44
阅读次数:
227
Divide two integers without using multiplication, division and mod operator.
思路:1.先将被除数和除数转化为long的非负数,注意一定要为long,因为Integer.MIN_VALUE的绝对值超出了Integer的范围。
2.常理:任何正整数num都可以表示为num=2^a+2^b+2^c+.....
分类:
其他好文 时间:
2014-06-25 19:46:17
阅读次数:
246
简析SynchronousQueue,LinkedBlockingQueue,ArrayBlockingQueue
三者都是blockingQueue.
LinkedBlockingQueue,ArrayBlockingQueue
有界,默认是Integer.Max;
SynchronousQueue没什么界不界的概念.之所以这么...
分类:
其他好文 时间:
2014-06-25 19:19:39
阅读次数:
397
【问题】
Evaluate the value of an arithmetic expression in Reverse Polish Notation.
Valid operators are +, -, *, /.
Each operand may be an integer or another expression.
Some examples:
...
分类:
编程语言 时间:
2014-06-24 23:22:53
阅读次数:
331
题目
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
Have you thought about this?
Here are some good questions to ask before coding. Bonus poin...
分类:
其他好文 时间:
2014-06-24 20:16:39
阅读次数:
180
一.建立数据库sqlite3.exe test.db二.双击sqlite-3_6_16目录下的程序sqlite3.exe,即可运行三.退出.exit或者.quit四.SQLite支持如下5种数据类型1.NULL:空值。2.INTEGER:带符号的整型,具体取决有存入数字的范围大小。3.REAL:浮点...
分类:
数据库 时间:
2014-06-24 14:20:01
阅读次数:
262
题目:Reverse IntegerReverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about...
分类:
其他好文 时间:
2014-06-24 14:12:18
阅读次数:
184
Intervals
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 20786
Accepted: 7866
Description
You are given n closed, integer intervals [ai, bi] and n integer...
分类:
其他好文 时间:
2014-06-22 16:36:24
阅读次数:
152
N-QueensThe n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, retu...
分类:
其他好文 时间:
2014-06-22 13:10:11
阅读次数:
188
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
Have you thought about this?
Here are some good questions to ask before coding. Bonus points for y...
分类:
其他好文 时间:
2014-06-22 09:31:16
阅读次数:
220