C语言数据结构插入算法
C语言数据结构插入算法
C语言数据结构
数据结构学习

->是二目运算符
p->a 引用了指针p指向的结构体的成员a。
整合
void unionL(List *La,list Lb){
int La_len,Lb_len,i;
ElemType e;
La_len=ListLength(*La);
Lb_len=ListLength(Lb);
for(i=1;i
GetElem(Lb,i,&e);
if(!LocateElem(*La,e)){
ListInsert(La,++La_len,e);
}
}
}
获取
typedef int Status;
Status GetElem(SqList L,int i,ElemType *e){
if(L.length==0||i<1||i>L.length){
return ERROR;
}
*e=L.data[i-1];
return OK;
}
插入
Status ListInsert(SqList *L,int i,ElemType e){
int k;
if(L->length=MAXSIZE){
return ERROR;
}
if(i<1||i>L->length+1){
return ERROR;
}
if(i<=L->length){
for(k+L->length-1;k>=i-1;k--){
L->data[k+1]=L->data[K];
}
}
L->data[i-1]=e;
L->length++;
return OK;
}
C语言数据结构插入算法相关教程
最后
以上就是矮小凉面最近收集整理的关于c语言数据结构插入算法说明,C语言数据结构插入算法的全部内容,更多相关c语言数据结构插入算法说明内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复