There are two sorted arrays A and B of size m
and n respectively. Find the median of the two sorted arrays. The overall run
time complexity should be ...
分类:
其他好文 时间:
2014-05-09 23:26:18
阅读次数:
353
是我算法不对,还是笔记本CPU太差?我优化了两次,还是花了三四个小时来得到结果。在输出上加1就是最终结果。The
sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes
below two mil...
分类:
其他好文 时间:
2014-05-09 16:20:08
阅读次数:
295
题目描述N integers are arranged on a circle clockwise.
Given two integers M and K. For each position, you should take M continuous
integers on the left an...
分类:
其他好文 时间:
2014-05-09 10:30:49
阅读次数:
350
Android provides a default Bluetooth stack,
BlueDroid, that is divided into two layers: The Bluetooth Embedded System (BTE),
which implements the core...
分类:
其他好文 时间:
2014-05-09 10:18:47
阅读次数:
518
一点小错,两次过,基本思想是先比较头元素,哪个小就在哪个list的基础上插入,需要考虑两种不同的结束方式 1
/** 2 * Definition for singly-linked list. 3 * public class ListNode { 4 * int
val; 5 *...
分类:
其他好文 时间:
2014-05-09 09:21:59
阅读次数:
273
戳我去解题Write an efficient algorithm that searches for
a value in anmxnmatrix. This matrix has the following properties:Integers in
each row are sorted f...
分类:
其他好文 时间:
2014-05-09 08:27:24
阅读次数:
241
这道题就是找规律啊!!!想想啊,11和10是可以连续的,那么10和11也是可以连续的。下面是AC代码:
1 /** 2 * The gray code is a binary numeral system where two successive values
differ in on...
分类:
其他好文 时间:
2014-05-09 07:38:17
阅读次数:
325
最近在看这本书。不过发现需要安装编译工具 lex, yacc。书上说Linux自带lex, yacc。不过我发现我的没有。并且,ubuntu不使用lex, yacc。输入sudo apt-get install yacc lex
会报错, 报错内容如下:Reading package lists... Done
Building dependency tree
Reading sta...
分类:
其他好文 时间:
2014-05-09 06:18:48
阅读次数:
989
原地归并。下面是AC代码: 1 public void merge(int A[], int m,
int B[], int n) { 2 3 int len = A.length; 4 //first copy m elements of A...
分类:
其他好文 时间:
2014-05-09 05:59:54
阅读次数:
297
计算机系统中有三种重要的数字表示,无符号(unsigned)编码,只能表示非负的数,补码(two's-complement)编码,用来表示有符号整数。...
分类:
其他好文 时间:
2014-05-09 00:26:42
阅读次数:
384