C (gcc)
是待插入元素。函
int·insertLink(LinkList-L,int·location,ElemType-x)
LNode-*pre,*s;
int.j=0;
pre=·L->next;
if(!pre·&& j<location-1) return;
while(pre)
j++;
if((location-1)!=j)
pre=pre->next;
elsel
s=(LNode *)malloc(sizeof(LNode));
s->data=x;
s-onext = pre->next;
pre-next = s;
66666666
最新推荐文章于 2024-11-06 20:43:37 发布