上一页 1 ··· 6 7 8 9 10 11 12 13 下一页
摘要: There is an 8*8 chess board in which two diagnolly opposite corners have been cut off. You are given 31 dominos, and a single domino can cover exactly... 阅读全文
posted @ 2014-08-20 10:38 米其林轮船 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Given a(decimal -e.g. 3.72)number that is passed in as a string, print the binary representation. If the number can not be represented accurately in b... 阅读全文
posted @ 2014-08-19 20:37 米其林轮船 阅读(228) 评论(0) 推荐(0) 编辑
摘要: An array A[1...n] contains all the integers from 0 to n except for one number which is missing.In this problem, we cannot access an entire integer in ... 阅读全文
posted @ 2014-08-19 17:30 米其林轮船 阅读(305) 评论(0) 推荐(0) 编辑
摘要: #include#include#includevoid swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp;}int myrand(int left, int right){ return (left+rand(... 阅读全文
posted @ 2014-08-09 19:33 米其林轮船 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 一.全排列无重复字符#include#includechar buf[1024];void func(int index);void swap(int index1,int index2);int main(){ memset(buf,0,sizeof(buf)); sprintf(bu... 阅读全文
posted @ 2014-08-09 11:25 米其林轮船 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 如果指针作为形参,要注意是否希望这个指针作为返回值返回。例如,在链表的插入函数中void Insert(Node *head,Node *x);当head == NULL时,我们希望令head = x,此时实际上只改变了head的副本,head并没有改变,因此正确的函数原型应该是void Inser... 阅读全文
posted @ 2014-08-08 10:54 米其林轮船 阅读(414) 评论(0) 推荐(0) 编辑
摘要: #include#includeclass KMP{public: KMP(const char *P,const char *Q); void Deal();private: void GenPi(); void Search(); char q[1024]; ... 阅读全文
posted @ 2014-08-08 09:50 米其林轮船 阅读(215) 评论(0) 推荐(0) 编辑
摘要: #includestruct Node{ int key; Node *p; Node *left; Node *right; Node(int k = 0) { p=NULL; left=NULL; right=NULL... 阅读全文
posted @ 2014-08-07 22:55 米其林轮船 阅读(332) 评论(0) 推荐(0) 编辑
摘要: 2.引用与指针有什么区别?引用必须被初始化,指针不必。引用初始化以后不能被改变,指针可以改变所指的对象。不存在指向空值的引用,但是存在指向空值的指针。6.堆栈溢出一般是由什么原因导致的? 没有回收垃圾资源。7.什么函数不能声明为虚函数?构造函数不能声明为虚函数。9.写出float x 与“零... 阅读全文
posted @ 2014-08-04 17:43 米其林轮船 阅读(385) 评论(0) 推荐(0) 编辑
摘要: 01背包的状态转换方程f[i,j] = Max{ f[i-1,j-Wi]+Pi( j >= Wi ), f[i-1,j] }f[i,j]表示在前i件物品中选择若干件放在承重为 j 的背包中,可以取得的最大价值。Pi表示第i件物品的价值,Wi表示第i件物品的重量。决策:为了背包中物品总价值最大化,第 ... 阅读全文
posted @ 2014-08-02 22:13 米其林轮船 阅读(161) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 下一页