上一页 1 ··· 9 10 11 12 13
摘要: /*本程序实现分块查找算法 又称索引顺序查找 需要注意的是分块查找需要2次查找 先对块查找 再对块内查找 2013.12.16 18:44*/ #include #define N 12 struct index { int key; int start; int end; }index[4]; ... 阅读全文
posted @ 2013-12-18 15:08 Android开发8585 阅读(306) 评论(0) 推荐(0) 编辑
摘要: /*本程序采用折半查找算法查找数据的位置 2013.12.06.18:11 */ #include int search(int a[],int l,int o)//实现折半查找 { int mid; int high=l-1;//notice int low=0; do { mi... 阅读全文
posted @ 2013-12-18 15:07 Android开发8585 阅读(209) 评论(0) 推荐(0) 编辑
摘要: /* 采用顺序查找方法,查找指定数据 2013.12.16 18.05*/ #include int search(int a[],int l,int o)//查找函数 { int i; for(i=0;i=0) printf("您查找的数据 %d在 %d处\n",input,result); goto m... 阅读全文
posted @ 2013-12-18 15:03 Android开发8585 阅读(125) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; class A { public: A() { cout<<"constructing A"<<endl; } ~A() { cout<<"desconstruting A"<<endl; } }; void disp() { A oo; } int main() { //A oo; disp(); cout<<"take a mark"<<endl; }当对象生存周期结束时,析... 阅读全文
posted @ 2013-12-18 14:33 Android开发8585 阅读(440) 评论(0) 推荐(0) 编辑
摘要: /* 1.只能重载c++提供的标准运算符 2.参数个数固定 3.针对类的对象操作运算符的重载形势只有两种: 一种是重载为类的友元行数特殊运算符的重载“--” “++” 等等http://c.chinaitlab.com/special/czhenyan/Index.html*/#include using namespace std; class base { public: int a1; float b1; base() { a1=0; b1=0.0; cout<<"constructing base "<<en... 阅读全文
posted @ 2013-12-18 12:31 Android开发8585 阅读(307) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;class base{protected: int x;public: base(int x1) { x=x1; cout<<"constructing base,x="<<x<<endl; } ~base() { cout<<"disconstructing base"<<endl; }};class ba... 阅读全文
posted @ 2013-12-14 22:40 Android开发8585 阅读(642) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13