freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)鄒永林版實驗報告2-順序表與鏈表(更新版)

2025-08-03 07:23上一頁面

下一頁面
  

【正文】 PrintList(L)。 scanf(%d,amp。amp。 case 3: printf(\n3Insert e into LinkList:\n)。amp。 if(L!=NULL) printf(\nInitLinkList OK!\n)。 /*將輸入的字符串轉(zhuǎn)化為整形數(shù)*/ } while (c0||c5)。 char s[3]。}/*CreateList*//*釋放鏈表及其空間*/void DestroyLinkList(LinkList L){ LNode *p=L,*q。 while(i=n) { q=(LNode *)malloc(sizeof(LNode))。 pnext=snext。}/*GetElem*//*(4)刪除第i位置的元素,成功返回OK,并由e返回其值,若不成功返回ERROR,注意刪除的結(jié)點必須釋放其所占空間*/int DeleteElem(LinkList L,int i,ElemType *e){ LNode *p=L,*s。 p=Lnext。 s=(LNode *)malloc(sizeof(LNode))。 p=pnext。 L=(LNode *)malloc(sizeof(LNode))。 /*帶頭結(jié)點單鏈表初始化*/void PrintList(LinkList L)。 case 0: exit(0)。sl,k,amp。sl)。 printf(\n input insert location and data:(location,data)\n)。sl,k,amp。 PrintList_sq(amp。Sqlist sl。 do { printf(\nEnter you choice(0~4):)。 } if(b==1) return 0。 return OK。 Llength+=1。aLlength。b++) { scanf(%d,amp。 } return 0。int PrintList_sq(Sqlist *L)。 /*定義表元素的類型*/typedef struct slist{ ElemType *list。【實驗學(xué)時】2學(xué)時【實驗預(yù)習(xí)】回答以下問題:順序表的存儲表示在順序表中,任一數(shù)據(jù)元素的存放位置是從起始位置開始、與該數(shù)據(jù)元素的位序成正比的對應(yīng)存儲位置,借助LOC(ai)=LOC(a1)+(i1)*1理解順序表、鏈表數(shù)據(jù)結(jié)構(gòu)的特點(優(yōu)缺點)。:includeincludeincludedefine ERROR 0define MAXSIZE 100define OK 1typedef int ElemType。int ListInsert_sq(Sqlist *L,int i,ElemType e)。 Llistsize=MAXSIZE。ba。 for(a=0。 Llist[i1]=e。 Llength=1。 } else b=1。i++) /*輸出主菜單數(shù)組*/ printf(%s,menu[i])。int deldata。 printf(\nPrint Sqlist:\n)。 if (!ListLocate(amp。 case 3: printf(\n4Insert from Sqlist:\n)。 PrintList_sq(amp。 if (ListDelete_sq(amp。 break。LNode *InitList()。 /*菜單函數(shù)*//*帶頭結(jié)點單鏈表初始化*/LNode *InitList(){LinkList L。 printf(\n第%d個元素%d,i,pdate)。 } if(!p||ji1) return ERROR。 int j=1。 return OK。 s=pnext。 p=L。 } return L。退出*/ \n***************MENU******************\n }。 /*輸入選擇項*/ c=atoi(s)。 L=InitList(L)。 if (L!=NULLamp。 break。 if(L!=NULLamp。 printf(input pos=)。 printf(\nPrintfList:\n)。 break。 case 0: printf(\nDestroy linklist and free memory ......\n)。提示:用一個無頭結(jié)點的循環(huán)單鏈表來實現(xiàn)n個元素的存儲。 printf(輸入元素:\n)。 scanf(%d,amp。 printf(%d\n,Ldata)。 for(a=1。 printf(被刪除的數(shù)字:%d\n,qdata)。 printf( )。includeincludedefine ERROR 0define OK 1typedef int ElemType。LinkList CreateList(int n)。 while(p) { printf(\nthe %d data is %d,i++,pdata)。 for(i=0。 p=q。 } a=q。 }}/* DestroyLinkList */int main(){ int n。 return 0。 L=
點擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1