//查找元素
int LocateELem(SqList L,ElemType e){
for(i=0;i<L.length;i++){
if(L.elem[i]==e){
return i+1;
}
}
return 0;
//0(1)平均时间复杂度
}//ASL平均查找长度(n+1)/2
//顺序表的插入
Status ListInsert_Sq(SqList&L,int i,ElemType e){
if(i<1||i>L.length+1){
return ERROR;
}
if(L.length==MAXSIZE){
return ERROR;
}
for(j=L.length-1;j>=i-1;j--){
L.elem[j+1]=L.elem[j];
L.elem[i-1]=e;
L.length++;
}
return OK;
}//0(N)平均时间复杂度。
//平均移动次数n/2;
//顺序表的删除
//判断删除位置是否合法(1<=i<=n)
//i+1个元素的值到i上
Status ListDelete_Sq(SqList&L,int i){
if((i<1)||(i>L.length)){
return ERROR;
}
for(j=i;j<=L.length-1;j++){
L.elem[j-1]=L.e