L.elem=(int *)malloc(100*sizeof(int));
intListInsert(SqList&L,inti,int e){
if(L.length>=L.listsize){
int *newbase=(int *)realloc(L.elem,(L.listsize+10)*sizeof(int));
L.elem=newbase;
L.listsize+=10;
}
int *q=&(L.elem[i-1]);
int *p=&(L.elem[L.length-1]);
for(p;p>=q;--p){
*(p+1)=*p;
intListDelete(SqList&L,inti,int&e){
if(i<1||i>L.length)
return 0;
int *p=&(L.elem[i-1]);
e=*p;
int *q=L.elem+L.length-1;
for(++p;p<=q;++p){
*(p-1)=*p;
评论0
最新资源