雙向循環(huán)鏈表68867

雙向循環(huán)鏈表68867

ID:18937071

大?。?3.00 KB

頁數(shù):21頁

時間:2018-09-27

雙向循環(huán)鏈表68867_第1頁
雙向循環(huán)鏈表68867_第2頁
雙向循環(huán)鏈表68867_第3頁
雙向循環(huán)鏈表68867_第4頁
雙向循環(huán)鏈表68867_第5頁
資源描述:

《雙向循環(huán)鏈表68867》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。

1、雙向循環(huán)鏈表68867#include"stdio.h"#include"string.h"typedefstructlist*LINK;LINKhead;/*頭指針,鏈表定位*/structlist{intdata;charname[8];chartel[12];intage;intscoure;structlist*front,*next;};FILE*fp;main(){charsearch(LINKp,charn);/*查詢*/LINKin_put(LINKp);/*輸入函數(shù)*/voidou

2、tput(LINKsp);/*輸出*/intinsert(LINKp2);/*插入*/intdel(LINKp2,intm);/*刪除*/voidcreat();/*輸入并創(chuàng)建鏈表*/voidread();/*讀取文件內(nèi)容*/voidwrite_fp();/*寫入文件*//**********************************************************************/voidexchange(LINKp1,LINKp2);/*數(shù)據(jù)交換*/LINKcomp

3、are(LINKsp,chardn,chardm);/*比較*/LINKbts(LINKsp,LINKp1,LINKp2,chardm);/*從大到小排列*/LINKstb(LINKsp,LINKp1,LINKp2,chardm);/*從小到大排列*//**********************************************************************/chara;FILE*fp;LINKout_fp;intd,num,menu;/*menu菜單控制變量*/i

4、f((fp=fopen("C:\table.txt","r"))==NULL)/*打開或建立文件*/{printf("Cannotopenthefile!Nowtheprogramwillbuildanewfile!");fp=fopen("C:\table.txt","wt+");/*打開文件*/creat();/*創(chuàng)建內(nèi)容*/out_fp=head;do{fprintf(fp,"%d%s%s%d%d",out_fp->data,out_fp->name,out_fp->tel,

5、out_fp->age,out_fp->scoure);out_fp=out_fp->next;}while(out_fp!=head);fclose(fp);/*關(guān)閉文件*/}else{read();/*讀取文件*/}output(head);/*輸出鏈表內(nèi)容*//*************************************************************************************/do{printf("/*****Commandmenulist

6、*****/1.Search2.Insert3.Delete4.Arrangement