int InsElem(SqList &sq,ElemType x,int i) /*插入元素*/{int j;if (i<1 || i>sq.length+1) /*无效的参数i*/return 0;for (j=sq.length;j>i-1;j--) //这里sq.data[j]=sq.data[j-1];sq.data[i-1]=x; /*在位置i处放入x*/sq.length++; /*线性表长度增1*...
include int merge(int a[],int b[],int an,int bn) { int i=0,j=0,k=0,temp,m[an+bn]; while(i
int a[N]={12,2,5,45,8},b[M]={58,7,6,98,5,12},c[M+N];//预设测试数据 int i,j,k;SelectSort(a,N);//先对两个无序数组进行排序 SelectSort(b,M);i=0;j=0;k=0;//c数组下标 while(i<N && j<M)//数组a,b有元素 { if(a[i] >= b[j])//将两者较小者放进...