摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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 ... 阅读全文
摘要:
#include#include#includevoid swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp;}int myrand(int left, int right){ return (left+rand(... 阅读全文
摘要:
一.全排列无重复字符#include#includechar buf[1024];void func(int index);void swap(int index1,int index2);int main(){ memset(buf,0,sizeof(buf)); sprintf(bu... 阅读全文
摘要:
如果指针作为形参,要注意是否希望这个指针作为返回值返回。例如,在链表的插入函数中void Insert(Node *head,Node *x);当head == NULL时,我们希望令head = x,此时实际上只改变了head的副本,head并没有改变,因此正确的函数原型应该是void Inser... 阅读全文
摘要:
#include#includeclass KMP{public: KMP(const char *P,const char *Q); void Deal();private: void GenPi(); void Search(); char q[1024]; ... 阅读全文
摘要:
#includestruct Node{ int key; Node *p; Node *left; Node *right; Node(int k = 0) { p=NULL; left=NULL; right=NULL... 阅读全文
摘要:
2.引用与指针有什么区别?引用必须被初始化,指针不必。引用初始化以后不能被改变,指针可以改变所指的对象。不存在指向空值的引用,但是存在指向空值的指针。6.堆栈溢出一般是由什么原因导致的? 没有回收垃圾资源。7.什么函数不能声明为虚函数?构造函数不能声明为虚函数。9.写出float x 与“零... 阅读全文