1 /* binarySearch 2 05/05/13 17:24 3 */ 4 #include5 #include 6 using namespace std; 7 int binarySearch(int *array,int low,int high,int value)// 返回value的位置,如果是-1则表示没找到 8 { 9 if(low<=high){10 int mid;11 mid= (low+high)/2;12 if(value==array[mid])13 return mid;14 else if(value >num;28 int *array=NULL;29 array = (int *)malloc(sizeof(int)*(num));30 cout<<"input the sorted array:"< >array[i];32 cout<<"input search value:"< >value;34 cout< <<"'s postion is:"< <