C语言链表基本操作

loading 分享 2026-8-20 下载文档

}

s=p->next;

while(s->next!=NULL)//主要置换过程 { }

s->next=p;

head->next->next=NULL;//收尾 head->next=s;//赋头

t=s->next; s->next=p; p=s; s=t;

//打印链表

voidprint_list(LNode * head) {

for(p=head->next;p!=NULL;) {

printf(\%d \p=p->next; LNode *p;

}

}

//链表查询

intfound_list(LNode *head,int n) {

LNode *p; inti=1;

for(p=head->next;p!=NULL;) }

{ }

if(NULL==p)

return 0; if(n==p->data) { } i++; p=p->next;

returni;


C语言链表基本操作.doc 将本文的Word文档下载到电脑
搜索更多关于: C语言链表基本操作 的文档
相关推荐
相关阅读