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

正文內(nèi)容

應(yīng)用數(shù)據(jù)結(jié)構(gòu)實(shí)驗(yàn)指導(dǎo)書-wenkub

2023-07-08 17:25:26 本頁面
 

【正文】 initialized to be empty. */void CreateQueue(Queue *q){ qcount=qfront=0。typedef struct queue{ int count。typedef struct plane{ int id。 } } while (cord=6)。 printf(\n 順序棧被置空!\n)。 printf(\n棧頂元素為:%d\n, y)。 case 3: { Pop(q)。a)。 OutStack(q)。cord)。 printf(\n 6 結(jié)束程序運(yùn)行\(zhòng)n)。 printf(\n 2 插入一個(gè)元素\n)。 do { printf(\n第一次使用必須初始化!\n)。}/*置空順序棧*/void setEmpty(SqStack *p){ ptop=1。 if(ptop0) printf(這是一個(gè)空棧!\n)。 else { printf(Underflow!\n)。 return(x)。}/*出棧*/ElemType Pop(SqStack *p){ ElemType x。/*初始化順序棧*/void InitStack(SqStack *p){ if(!p) printf(Error)。 default: printf(選擇錯(cuò)誤,重新開始!\n)。 break。 break。k)。 printf( | |\n)。 printf( | |\n)。 /*控制循環(huán)的標(biāo)志*/ while(1) { printf( \n)。 printf(%d\t%s\t%d\n,pnum,pname,pscore)。 return(h)。 p=pnext。k)。 q=h。 printf(%d\t%s\t%d\n,pnum,pname,pscore)。 while(pamp。 p=hnext。 r=rnext。 qnext=NULL。 scanf(%s, qname)。 printf(輸入待插入學(xué)生的學(xué)號(hào):\n)。}/**/list *insert(list *h){ list *p,*q,*r,*head。 pnext=NULL。 scanf(%s, pname)。 printf(輸入學(xué)生的學(xué)號(hào):\n)。n)。 headnext=NULL。 }list。5.實(shí)驗(yàn)內(nèi)容及步驟A.線性表部分——學(xué)生成績(jī)管理是學(xué)校教務(wù)管理的重要組成部分,其處理信息量很大,本實(shí)驗(yàn)是對(duì)學(xué)生的成績(jī)管理作一個(gè)簡(jiǎn)單的模擬,用菜單選擇操作方式完成下列功能:① 登記學(xué)生成績(jī)② 查詢學(xué)生成績(jī)③ 插入學(xué)生成績(jī)④ 刪除學(xué)生成績(jī)【參考程序】/**/includeincludeincludedefine MAXLEN 100typedef struct node{ int num。該系統(tǒng)中的數(shù)據(jù)采用線性表中的鏈?zhǔn)酱鎯?chǔ)結(jié)構(gòu)即單鏈表來存儲(chǔ),用結(jié)構(gòu)體類型定義每個(gè)學(xué)生記錄,故該單鏈表中每個(gè)結(jié)點(diǎn)的結(jié)構(gòu)可描述為:define MAXLEN 100typedef struct node{ int num;//學(xué)號(hào) char name[MAXLEN];//姓名 float score;//成績(jī) struct node *next。3.主要儀器設(shè)備及耗材安裝有Turbo C++ ,無耗材要求。③ “假上溢”現(xiàn)象。“下溢”是正?,F(xiàn)象,常用作程序控制轉(zhuǎn)移的條件。隊(duì)列的順序存儲(chǔ)結(jié)構(gòu)稱為順序隊(duì)列,順序隊(duì)列實(shí)際上是運(yùn)算受限的順序表。通常棧空作為一種控制轉(zhuǎn)移的條件。鏈表中插入結(jié)點(diǎn)的指針變化和刪除p所指結(jié)點(diǎn)的指針變化參見講義。此外,本門課程設(shè)計(jì)的算法比較多,要求教師熟練掌握C語言和數(shù)據(jù)結(jié)構(gòu)各類算法,并能準(zhǔn)確理解和回答學(xué)生提出的編程問題。實(shí)驗(yàn)的作用在于幫助學(xué)生深入理解教材內(nèi)容,鞏固基本概念,促使學(xué)生在動(dòng)手過程中進(jìn)一步體會(huì)C語言中數(shù)據(jù)結(jié)構(gòu)的運(yùn)用技巧,并鍛煉學(xué)生在調(diào)試過程中分析和發(fā)現(xiàn)問題的能力。2.實(shí)驗(yàn)教學(xué)的要求學(xué)生應(yīng)掌握C語言基本編程能力并運(yùn)用數(shù)據(jù)結(jié)構(gòu)的原理和方法解決具體問題。二、實(shí)驗(yàn)項(xiàng)目及學(xué)時(shí)分配序號(hào)實(shí) 驗(yàn) 項(xiàng) 目 名 稱實(shí)驗(yàn)學(xué)時(shí)實(shí)驗(yàn)類型開出要求1線性數(shù)據(jù)結(jié)構(gòu)算法驗(yàn)證4驗(yàn)證及演示必做2非線性數(shù)據(jù)結(jié)構(gòu)算法驗(yàn)證4驗(yàn)證及演示必做3查找及排序4驗(yàn)證及演示必做4綜合算法設(shè)計(jì)4綜合必做三、參考資料李業(yè)麗、鄭良斌編著,數(shù)據(jù)結(jié)構(gòu)(C)實(shí)驗(yàn)教程,北京理工大學(xué)出版社,2005年12月出版嚴(yán)蔚敏,吳偉民編著,數(shù)據(jù)結(jié)構(gòu)習(xí)題集(C語言版),清華大學(xué)出版社,1999年2月出版。棧的順序存儲(chǔ)結(jié)構(gòu)簡(jiǎn)稱為順序棧,它是運(yùn)算受限的順序表。注意:① 順序棧中元素用向量存放。入隊(duì)時(shí),將新元素插入rear所指的位置,然后將rear加1,出隊(duì)時(shí),刪去front所指的元素,然后將front加1并返回被刪除元素。② “真上溢”現(xiàn)象。由于入隊(duì)和出隊(duì)操作中,頭尾指針只增加不減小,致使被刪元素的空間永遠(yuǎn)無法重新利用。4.實(shí)驗(yàn)方案或技術(shù)路線本實(shí)驗(yàn)含有三部分內(nèi)容——線性表、棧和隊(duì)列。 }linklist。 char name[MAXLEN]。/**/includelist *create(){ list *head, *p, *r。 r=head。 for(i=l。 scanf(%d, amp。 printf(輸人李生的成績(jī):\n)。 rnext=p。 head=r=h。 scanf(%d,amp。 printf(輸入成績(jī):\n)。 while(p) { r=p。 return(head)。 printf(輸入要查找學(xué)生的學(xué)號(hào):\n)。amp。 } else printf(沒找到!\n)。 p=hnext。 while(pamp。 } if(p) { qnext=pnext。}/**/void output(list *h){ list *p。 p=pnext。 printf( | 學(xué)生成績(jī)管理 |\n)。 printf( | 3:插入成績(jī) |\n)。 printf( \n)。 switch(k) { case 1: p=create()。 case 3: p=insert(p)。 case 5: output(p)。 } }}B.棧部分——編寫一個(gè)程序?qū)崿F(xiàn)順序棧的各種基本運(yùn)算,并在此基礎(chǔ)上設(shè)計(jì)一個(gè)主程序,完成如下功能:① 初始化順序棧② 插入元素③ 刪除棧頂元素④ 取棧頂元⑤ 遍歷順序棧⑥ 置空順序棧【參考程序】includeincludedefine MAXNUM 20define ElemType int/*定義順序棧的存儲(chǔ)結(jié)構(gòu)*/typedef struct{ ElemType stack[MAXNUM]。 ptop=l。 if(ptop!=O) { x=pstack[ptop]。 } else { printf(Underflow!\n)。 return(0)。 for(i=ptop。} /*主函數(shù)*/main(){ SqStack *q。 printf(\n)。 printf(\n 3 刪除棧頂元素\n)。 printf(\n\n)。 printf(\n)。 } break。 Push(q, a)。 OutStack(q)。 OutStack(q)。 OutStack(q)。}C.隊(duì)列部分——熟悉講義中隊(duì)列的各種基本運(yùn)算,并在此基礎(chǔ)上設(shè)計(jì)一個(gè)主程序,完成如下功能:① 模擬一個(gè)機(jī)場(chǎng)飛機(jī)起降的過程② 機(jī)場(chǎng)僅有一條跑道,要求起飛與降落不能同時(shí)進(jìn)行③ 進(jìn)場(chǎng)飛機(jī)若暫時(shí)沒有跑道可用須在空中盤旋等候④ 離場(chǎng)飛機(jī)若暫時(shí)沒有跑道可用須在地面排隊(duì)等候⑤ 僅當(dāng)空中無飛機(jī)等待降落時(shí)地面飛機(jī)方可起飛⑥ 飛機(jī)的申請(qǐng)進(jìn)場(chǎng)、降落、申請(qǐng)離場(chǎng)和起飛分別視為獨(dú)立事件⑦ 每個(gè)事件的發(fā)生占用一個(gè)時(shí)間單位。 /* identification number of airplane */ int tm。 /* number of airplanes in the queue */ int front, rear。 qrear=1。s answer begins with either y or Y, False if the user responds with any response beginning with either n or N.*/Boolean UserSaysYes(void){ int c。) 。Y39。N39。Y39。}/* Randomize: set staring point for pseudorandom integers. */void Randomize(void){ srand((unsigned int)(time(NULL)%10000))。 scanf(%d, endtime)。 printf( Expected number of departures per unit time? )。 } else if (*expectarrive+*expectdepart) { printf( The airport will bee saturated. Read new numbers?)。 printf(\n)。 /* pseudorandom number */ while (xlimit) { n++。 pid=*nplanes。 case DEPART: printf( Plane %3d ready to take off.\n, *nplanes)。}/* Append: append an entry to the queue. Pre: The queue q has been created and is not full. Post: The entry x has been stored in the queue as its last entry. Uses: QueueFull, Error. */void Append(QueueEntry x, Queue *q){ if (QueueFull(q)) Error(Cannot append an entry to a full queue.)。 }}/* Serve: remove the first entry in the queue. Pre: The queue q has been create and is not empty. Post: The first entry in the queue has been removed and returned as the value of x. Uses: QueueEmpty, Error. */void Serve(QueueEntry *x, Queue *q){ if (QueueEmpty(q)) Error(Cannot serve froman empty queue.)。 }}/* QueueSize: return the number of entries in the queue. Pre: The queue q has been created. Post: The function returns the number of entries in the queue q. */int QueueSize(Queue *q){ return qcount。 ++*nland。 case DEPART: printf( Plane %3d told to try later.\n, )。 printf(%3d: Plane %3d took off。}/* Idle: updates variables for idle runway.
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1