Given an unsorted array of integers, find the
length of the longest consecutive elements sequence.For example,Given[100, 4,
200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2014-05-10 20:06:26
阅读次数:
404
1.SI和DI
功能和bx相似,只是不能分成2个8寄存器使用。
2INC ax指令
将寄存器的内容加1
mov ax,0
inc ax
执行完毕ax=1
3.bx,si,di,bp寄存器
CPU的核心是寄存器,学习汇编这么一段时间,我也深刻体会到对寄存器理解的重要性
(1)在8086CPU中,只有这4个寄存器可以在[...]中来进行内存单元的寻址。比如下面指令是正...
分类:
其他好文 时间:
2014-05-02 23:41:43
阅读次数:
430
29:数组中出现次数超过一半的数字 方法a. 排序取中 O(nlogn) 方法b.
partition 函数分割找中位数 >=O(n) 方法 c. 设计数变量,扫描一遍。 O(n)#include int findNumber(int
data[], unsigned length){/* if(c...
分类:
其他好文 时间:
2014-05-02 19:47:41
阅读次数:
535
Where's Waldorf?
Given a m by n grid
of letters, ( ),
and a list of words, find the location in the grid at which the word can be found. A word matches a straight, uninterrupted line o...
分类:
其他好文 时间:
2014-05-02 10:59:15
阅读次数:
514
少数次通过 1 public class Solution { 2 public int[]
plusOne(int[] digits) { 3 int[] carry=new int[digits.length+1]; 4 int[]
results=new i...
分类:
其他好文 时间:
2014-05-02 08:23:11
阅读次数:
271
许多次通过,主要是没有考虑到这种情况:“A C ”结尾有多重空格的情况。 1 public class
Solution { 2 public int lengthOfLastWord(String s) { 3 int j, k; 4 if(s == nu...
分类:
其他好文 时间:
2014-05-02 08:21:00
阅读次数:
300
1.ret
指令用栈中的数据,修改IP的内容,从而实现近转移
CPU执行ret指令时,进行下面两步操作:
(1)(IP)=((ss)*16+(sp)) //使用栈顶元素修改IP实现跳转
(2)(sp)=(sp)+2
2.retf
用栈中的数据,修改CS和IP的内容,从而实现远转移
CPU执行retf指令时,进行下面四步操作:
(1)(IP)=((ss)*16+(sp))
...
分类:
其他好文 时间:
2014-05-02 06:54:21
阅读次数:
394
最近在看Jdk6中String的源码的时候发现String的有个这样的构造方法,源代码内容如下:
public String(String original) {
int size = original.count;
char[] originalValue = original.value;
char[] v;
if (originalValue.length > size) {
...
分类:
其他好文 时间:
2014-05-02 06:34:52
阅读次数:
237
现象:rengh@rengh-vm:~$ sudo apt-get install
ia32-libs[sudo] password for rengh: 正在读取软件包列表... 完成正在分析软件包的依赖关系树 正在读取状态信息... 完成
现在没有可用的软件包 ia32-...
分类:
其他好文 时间:
2014-05-02 05:42:49
阅读次数:
308
方法一:32位的系统中int类型和long类型一般都是4字节;64位的系统中int类型还是4字节的,但是long已变成了8字节;linux系统中可用"getconfWORD_BIT"和"getconfLONG_BIT"获得word和long的位数;64位系统中应该分别得到32和64;[root@bogon~]#getconfLONG_BIT64方法二:[root@ro..
分类:
系统相关 时间:
2014-05-02 03:04:35
阅读次数:
300