ImageVerifierCode 换一换
格式:DOCX , 页数:19 ,大小:17.89KB ,
资源ID:19679776      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/19679776.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(双向循环链表Word格式.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

双向循环链表Word格式.docx

1、 int insert(LINK p2); int del(LINK p2,int m);/* void creat(); void read();/* void write_fp();/* /*/ void exchange(LINK p1,LINK p2); LINK compare(LINK sp,char dn,char dm);/* LINK bts(LINK sp,LINK p1,LINK p2,char dm);/* LINK stb(LINK sp,LINK p1,LINK p2,char dm); char a; FILE *fp; LINK out_fp; int d,nu

2、m,menu;/*menu if(fp=fopen(C:table.txt,r)=NULL)/* printf(Can not open the file!nNow the program will build a new file!n); fp=fopen(wt+ creat(); out_fp=head; do fprintf(fp,%d %s %s %d %dn,out_fp-data,out_fp-name, out_fp-tel,out_fp-age,out_fp-scoure); out_fp=out_fp-next; while(out_fp!=head); fclose(fp)

3、;/* else read(); output(head);/*/ do /*Command menu list*/n1.Searchn2.Insertn3.Deleten4.Arrangementn0.Exitn/* printf(Please select an option: a=getch();%cn,a); if(a=1) break; else if(a=2340 exit(1); else menu=1; while(menu); /*/ if(a= char dm,dn;Order of (1.name 2.scoure)?: dm=getch();,dm); if(dm=)|

4、(dm=)Order from (1.big to small 2.small to big)? dn=getch();,dn); if(dn=)|(dn= head=compare(head,dn,dm); else Invalid Options! else output(head); /*/Save to the file?(y/n):y write_fp(); printf(Save complete! n read(); while(a!=)&(a!);Order again? num=1; num=0;menu=1; while(num); read();/*/ else if(a

5、= printf(Please enter the items you want to search:n(1.name 2.tel 3.age 4.scoure):Options:/* fflush(stdin);/*IO d=getch();,d); search(head,(char)d); doSearch again? a=getch(); if(a= num=1; num=0; while(a! while(num);/*search*/*/ Insert data? num=insert(head); num=0;/*/ which number do you want to de

6、lete:NO. d=getch(); num=del(head,d); output(head);Delete again? printf( scanf(%d,&d); while(a=getchar()!na!=EOF);/* num=del(head,d); output(head); /*/ write_fp(); menu=0; menu=1; while(menu); exit(1);char search(LINK p,char n)/*/ LINK a=p; char b9; int c; if(n=)|(n=Enter the content: scanf(%s,b); if

7、(strcmp(a-name,b)=0)|(strcmp(a-tel,b)=0)%3d. |%8s|%15s|%8d|%8d|n,a-data, a-name,a-tel,a-age,a- return(0); a=a- while(a!=p);No Datan return(0); else if(n=c); if(a-age=c)|(a-scoure=c) return(0);void output(LINK sp)/*/ int i; sp=head; n num | name | tel | age | scoure |n for(i=1;i+) sp-data=i;/*/,sp- s

8、p-name,sp-tel,sp-age,sp- sp=sp- if(sp=head) break;int insert(LINK p2)/*/ LINK sp,newnode; int i=0; sp=p2-front; newnode=(LINK)malloc(sizeof(struct list); if(newnode=NULL)ERRORn return(1); in_put(newnode); newnode-next=sp- sp-next-front=newnode;front=sp;next=newnode;insert complete! return(1);int del

9、(LINK p2,int m)/* LINK sp; int a,i=0; sp=p2; i+; while(sp! if(m=1) head=head- if(1m)&(m=i) for(a=1;a if(mi)|(mfront=sp- free(sp);delete complete!void creat()/* LINK pb,newnode; for(i=0; newnode=(LINK)malloc(sizeof(struct list); newnode-data=i+1; in_put(newnode); num | name | tel | age | scoure |n,ne

10、wnode-name,newnode-tel,newnode-age,newnode-sure?(press to continue):/* while(a=getch()! if(i=0) pb=head=newnode;head-front=NULL;next=NULL;/* pb-/*front=pb; pb=newnode;nInsert again? if(a=getch()= continue; break; head- pb-next=head;void read()/*/*num fp=fopen( fscanf(fp,newnode-data,& &tel,&age,& pb

11、=head=newnode; /* pb- if(feof(fp)break; head- pb- void write_fp()/* if(fp=fopen()=NULL)/*LINK in_put(LINK p)/*please input the name: scanf(p-name);please input the tel:tel);please input the age: scanf(age);please input the scoure: scanf( return(p);/*/LINK compare(LINK sp,char dn,char dm) LINK p1,p2,p0; p1=p0=sp; p2=p1- if(dn= if(dm= for(;p2!=sp;p2=p2-next) if(strcmp(p2-name,p1-name)0) p1=p2; sp=p1; p0=sp; (p0-next)!p0=p0- p1=p0- p2=p1- for(; if(p0-next!=p1) exchange(p0,p1);

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1