算法与数据结构试题 急用!!!答:void printarray(elemtype a[],int n); //打印数组数据 int main(){ int i,x;const int n=9;elemtype a1[10]={0,34,23,12,56,90,78,89,45,67};elemtype a2[10]={0,12,23,34,45,56,67,78,89,90};//顺序查找 cout<<"顺序查找:"<<endl;cout<<"a1[]=";printarray(a1,...
数据结构的算法 请帮忙解答这两道题~答:} //以上是递归算法,易理解 int main(){ int a[5]={1,2,3,4,5};bin_search(a,1,5,4);system("pause");return 0;} include <stdio.h> include <stdlib.h> int search(int p[],int low,int high,int index){ int mid;while(low<high){ mid=(low+high)/2;if (p[mid]==...