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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)鄒永林版實(shí)驗(yàn)報(bào)告2-順序表與鏈表-文庫(kù)吧

2025-06-10 07:23 本頁面


【正文】 *以字符形式保存選擇號(hào)*/ int c,i。 /*定義整形變量*/ for (i=0。i7。i++) /*輸出主菜單數(shù)組*/ printf(%s,menu[i])。 do { printf(\nEnter you choice(0~4):)。 /*在菜單窗口外顯示提示信息*/ scanf(%s,s)。 /*輸入選擇項(xiàng)*/ c=atoi(s)。 /*將輸入的字符串轉(zhuǎn)化為整形數(shù)*/ } while (c0||c4)。 /*選擇項(xiàng)不在0~4之間重輸*/ return c。 /*返回選擇項(xiàng),主程序根據(jù)該數(shù)調(diào)用相應(yīng)的函數(shù)*/}/*主函數(shù)*/int main(){ int m,k。 int pos。int deldata。Sqlist sl。 InitList_sq(amp。sl)。 for (。) /*無限循環(huán)*/ { switch (menu_select()) /*調(diào)用主菜單函數(shù),返回值整數(shù)作開關(guān)語句的條件*/ { case 1: printf(\n1Create Sqlist:\n)。 CreateList_sq(amp。sl)。 printf(\nPrint Sqlist:\n)。 PrintList_sq(amp。sl)。 break。 case 2: printf(\n3GetElem from Sqlist:\n)。 printf(please input search data:)。 scanf(%d,amp。k)。 if (!ListLocate(amp。sl,k,amp。pos)) printf(Not found)。 else { printf(found the element, position is %d\n,pos)。 printf(\nPrint Sqlist:\n)。 PrintList_sq(amp。sl)。 } break。 case 3: printf(\n4Insert from Sqlist:\n)。 printf(\n input insert location and data:(location,data)\n)。 scanf(%d,%d,amp。m,amp。k)。 if (ListInsert_sq(amp。sl,m,k)) { printf(\nOK\n)。 printf(\nPrint Sqlist:\n)。 PrintList_sq(amp。sl)。 } else printf(\nERROR!)。 break。 case 4: printf(\n5Delete from Sqlist:\n)。 printf(\nplease input delete location\n)。 scanf(%d,amp。k)。 if (ListDelete_sq(amp。sl,k,amp。deldata)) { printf(\nOK\n)。 printf(\nDelete data is %d\n,deldata)。 printf(\nPrintSqlist:\n)。 PrintList_sq(amp。sl)。 } else printf(\nERROR!)。 break。 case 0: exit(0)。 /*如菜單返回值為0程序結(jié)束*/ } } return 0。}(1)創(chuàng)建一個(gè)順序表(2)查找元素位置(3)插入元素(4)刪除元素實(shí)現(xiàn)單鏈表的相關(guān)操作。:includeincludeincludedefine ERROR 0define OK 1typedef int ElemType。 /*定義表元素的類型*//*(1)線性表的單鏈表存儲(chǔ)表示*/typedef struct LNode{ ElemType date。 struct LNode *next。}LNode,*LinkList。LNode *InitList()。 /*帶頭結(jié)點(diǎn)單鏈表初始化*/void PrintList(LinkList L)。 /*輸出帶頭結(jié)點(diǎn)單鏈表的所有元素*/int GetElem(LinkList L,int i,ElemType *e)。 /*查找第i位置的元素,并由e返回其值*/int InsertElem(LinkList L,int i,ElemType e)。/*在第i個(gè)位置插入元素e*/int DeleteElem(LinkList L,int i,ElemType *e)。/*刪除第i位置的元素,并由e返回其值*/void DestroyLinkList(LinkList L)。/*釋放鏈表及其空間*/LinkList CreateList(int n)。 /*創(chuàng)建n個(gè)結(jié)點(diǎn)的單鏈表*/int menu_select()。 /*菜單函數(shù)*//*帶頭結(jié)點(diǎn)單鏈表初始化*/LNode *InitList(){LinkList L。 L=(LNode *)malloc(sizeof(LNode))。 /*申請(qǐng)一個(gè)頭結(jié)點(diǎn)*/ if (!L) return ERROR。 /*申請(qǐng)失敗*/ Lnext=NULL。 /*頭結(jié)點(diǎn)的指針域置空*/ return L。}/*(1
點(diǎn)擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計(jì)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1