1。对于数组A[0,1,2,3,4,...,k],求得0 &array) {
if(array.size() == 0 || array.size() == 1) return -1; if(array.size() == 2) {
return array[1] - array[0];...
分类:
其他好文 时间:
2014-06-10 21:44:16
阅读次数:
401
Question: Mergeksorted linked lists and return
it as one sorted list. Analyze and describe its complexity.Solution: Find the
smallest list-head first....
分类:
其他好文 时间:
2014-06-10 19:51:30
阅读次数:
278
80X86上的函数/过程调用.call指令来调用过程;ret指令(return)返回调用程序.过程如下:1)确定执行完过程后要返回的指令地址(返回/链接地址).2)将该地址保存到已知位置.在没有递归时,可将其放在任意位置.放到内存中的栈是最常见的,执行过程:call->push/ret->pop优点...
分类:
其他好文 时间:
2014-06-10 19:47:08
阅读次数:
272
1 #include 2 int main() 3 { 4 int a,b; 5
while(scanf("%d %d",&a,&b)){ 6 if(a==0&&b==0)return 0; 7 else
printf("%d\n",a+b); 8...
分类:
其他好文 时间:
2014-06-10 12:04:06
阅读次数:
180
1 #include 2 int main()3 {4 int a,b;5
while(scanf("%d %d",&a,&b)!=EOF){6 printf("%d\n",(a+b));7 } 8 return 0;9
}说明:记得判断 !=EOF ...
分类:
其他好文 时间:
2014-06-10 12:00:04
阅读次数:
265
1 #include 2 int main() 3 { 4 int n,sum=0; 5
while(scanf("%d",&n)){ 6 if(n==0) {return 0;} 7 else{ 8 int i,a; 9 ...
分类:
其他好文 时间:
2014-06-10 11:52:19
阅读次数:
312
1 #include 2 int main()3 {4 int a,b;5
while(scanf("%d %d",&a,&b)!=EOF){6 printf("%d\n\n",a+b);7 }8 return 0;9
}
分类:
其他好文 时间:
2014-06-10 11:24:26
阅读次数:
253
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
Clarification:
What constitutes a word?
A sequence of non-space ch...
分类:
其他好文 时间:
2014-06-10 11:12:06
阅读次数:
185
int removeDuplicates(int A[], int n) {
if(n <= 1)
return n;
int newIndex = 0;
for(int i = 1; i < n; ++i){
if(A[i] != A[newIndex])
A[++newIndex] ...
分类:
其他好文 时间:
2014-06-10 10:57:49
阅读次数:
131
Given a string s consists of upper/lower-case alphabets and empty space characters '
', return the length of last word in the string.
If the last word does not exist, return 0.
Note: A word is...
分类:
其他好文 时间:
2014-06-10 10:52:03
阅读次数:
180