文档分类
面向对象程序设计期末考试
mid=(low+high)/2;
if(x==a[mid]); ⑴
else if(x<a[mid])high=mid-1;
else; ⑵
}
return -1;
⑴return mid ⑵low=mid+1
3.请补充完整如下的类定义:
#include<string.h>
class A{
char *a;
public:
A(){a=0;}//定义无参构造函数,使A的值为空