上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 29 下一页
摘要: Implement pow(x,n).第一个版本:double pow(double x, int n){ if(n==0) return 1.0; if(n0) { if(n%2==0) return pow(x, n/2) *... 阅读全文
posted @ 2014-03-08 18:18 海滨银枪小霸王 阅读(141) 评论(0) 推荐(0)
摘要: Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep... 阅读全文
posted @ 2014-03-08 16:33 海滨银枪小霸王 阅读(113) 评论(0) 推荐(0)
摘要: 本人是在ubuntu13.10上安装成功的。1. 首先下载驱动:https://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=15817&lang=eng&wapkw=82579。2.驱动中有一个README,按照其步骤安装即可3. ... 阅读全文
posted @ 2014-03-07 17:35 海滨银枪小霸王 阅读(717) 评论(0) 推荐(0)
摘要: 这个耗时原因很多,cpu主频,操作系统位数,指令集等都密切相关。如果要真正测试准确数据是不可能的。实际开发中,总有人说优化时去年打印printf会提高很多的样子,洒家深表反对,对此应该完全可忽略。除非是特殊情况,比如嵌入式的cpu主频极低,或者调用一次printf的实现确实耗费很长时间,大部分应该把... 阅读全文
posted @ 2014-03-05 16:24 海滨银枪小霸王 阅读(652) 评论(0) 推荐(0)
摘要: int A[nSize],其中隐藏着若干0,其余非0整数,写一个函数int Func(int* A, int nSize),使A把0移至后面,非0整数移至数组前面并保持有序,返回值为原数据中第一个元素为0的下标。(尽可能不使用辅助空间且考虑效率及异常问题,注释规范且给出设计思路)#includeus... 阅读全文
posted @ 2014-03-05 11:59 海滨银枪小霸王 阅读(305) 评论(0) 推荐(0)
摘要: 编译通过, 运行多线程时出现如下问题:[xcb] Unknown request in queue while dequeuing[xcb] Most likely this is a multi-threaded client and XInitThreads has not been calle... 阅读全文
posted @ 2014-03-04 11:44 海滨银枪小霸王 阅读(995) 评论(0) 推荐(0)
摘要: 1.importjava.io.File;2.Filef1=newFile(“d:\\a.txt”);3.publicFile(Stringpathname)publicFile(Stringparent,Stringchild)4.publicbooleancreateNewFile()throw... 阅读全文
posted @ 2014-03-03 16:14 海滨银枪小霸王 阅读(123) 评论(0) 推荐(0)
摘要: 最大子串和题目描述:给出一个整数序列S,其中有N个数,定义其中一个非空连续子序列T中所有数的和为T的“序列和”。对于S的所有非空连续子序列T,求最大的序列和。变量条件:N为正整数,N≤1000000,结果序列和在范围(-2^63,2^63-1)以内。输入:第一行为一个正整数N,第二行为N个整数,表示... 阅读全文
posted @ 2014-03-03 11:14 海滨银枪小霸王 阅读(173) 评论(0) 推荐(0)
摘要: Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express... 阅读全文
posted @ 2014-02-26 09:30 海滨银枪小霸王 阅读(124) 评论(0) 推荐(0)
摘要: static的作用:1. 修饰函数, 静态函数, 只在本文件中有用, 作用:~只自己使用, 保护代码。~避免重名2. 修饰局部变量~ 存储在静态区~ 编译时就赋值, 且只一次, 若未赋值, 则赋0~ 生存期直到程序结束3. 修饰全局变量~ 作用域从定义处到文件结束~ 不可在其它文件中extern,... 阅读全文
posted @ 2014-02-24 09:53 海滨银枪小霸王 阅读(211) 评论(0) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 29 下一页