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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)上機實驗報告-在線瀏覽

2024-09-13 23:59本頁面
  

【正文】 ta。}linklist。head)//建立單鏈表{ datatype x。 head=new linklist。 cinx。$39。 sdata=x。 r=s。 } rnext=NULL。 while(p!=NULL) { coutpdata。 } coutendl。 while(p!=head) { coutpdata。 } coutendl。 while(qnext!=h) q=qnext。 pnext=h。 headnext =NULL。 p=pnext。039。amp。939。 else if ((tdata =39。 amp。 tdata =39。) || (tdata =39。 amp。 tdata =39。)) insert(letter,t)。 } return。 實驗結(jié)果四、個人思路 順序表做逆置操作時將對應的首尾元素位置交換,單鏈表的指針end指向鏈表的末尾,指針start指向鏈表頭結(jié)點,指針s用來找到指向end節(jié)點的節(jié)點,將指向鏈表末尾和頭結(jié)點的存儲內(nèi)容交換,然后頭結(jié)點指針指向下一節(jié)點,s指針從start節(jié)點開始遍歷尋找指向end指針的節(jié)點,并將end指針賦值為s指針,就完成了單鏈表的逆置,可以看出單鏈表和順序表都可以完成線性表的逆置。實驗二 棧和隊列一、實驗目的1. 熟悉棧和隊列的順序和鏈式存儲結(jié)構(gòu)2. 掌握棧和隊列的基本運算3. 能夠利用棧和隊列的基本運算完成棧和隊列應用的運算二、實驗代碼1. 假設(shè)以數(shù)組sequ[m]存放循環(huán)隊列的元素,同時設(shè)變量rear和quelen分別指示循環(huán)隊列中隊尾元素的位置和內(nèi)含元素的個數(shù)。提示:隊空的條件:sqquelen==0;隊滿的條件:sqquelen==m。datatype x, *p。sq=new qu。do{ cout Queue Queue :。switch(key){ case 1: coutEnter the Data:。 enqueue(sq,x)。 case 2: p=dequeue(sq)。 break。 }}while(1)。 if(sqquelen==0) { printf(隊列為空,請先進行入隊操作\n)。 } else { temp=(datatype*)malloc(sizeof(datatype))。 *temp=sqsequ[(sqrearsqquelen+m)%m]。 return (temp)。 else { sqquelen++。 sqsequ[sqrear]=x。 } }//constint m=5。typedefstruct{ datatypesequ[m]。}qu。sqquelen=0。2. 設(shè)單鏈表中存放有n個字符,試編寫算法,判斷該字符串是否有中心對稱的關(guān)系,例如xyzzyx是中心對稱的字符串。)(文件夾:習題4)//includeincludeincludeincludeincludeincludeincludeincludeinclude void main(){ linklist *head。 datatypestr[80]。 creat(head,str)。 setnull(s)。 else cout字符串\str\不是中心對稱\n。typedefstruct node{ datatype data。}linklist。typedefstruct{ datatype elements[maxsize]。}stack。head,datatype*str){ datatype *p=str。head=new linklist。while(*p!=39。) { s=new linklist。 rnext=s。 p++。}//int symmetry(linklist*head,stack*s) { int n=length(head)/2。 datatype x。in。 p=pnext。 while(p!=NULL) { x=pop(s)。 else return 0。 }//int length(linklist*head){ linklist *p=headnext。while(p!=NULL){ n++。 }return n。while(p!=NULL){ coutpdata。 }coutendl。 stop。 return temp。 selements[stop]=e。s){ s=new stack。}截圖見下方實驗結(jié)果。出隊時頭指針front后移一位,如果front=sequ[m],front指向sequ[0],否則front++,quelen1,從而實現(xiàn)入隊與出隊的操作。 實驗三 數(shù)組一、實驗目的1. 熟悉數(shù)組的結(jié)構(gòu)2. 掌握矩陣的進行運算二、實驗代碼 若在矩陣Amn中存在一個元素A[i1[j1],其滿足A[i1[j1]是第i行元素中最小值,且又是第j列元素中最大值,則稱此元素為該矩陣的一個馬鞍點。(文件夾:習題5)//includeiostreamincludeincludeusing namespace std。 int i, j。im。jn。 minmax(pa)。}//constint m=3。typedefstruct{ int A[m][n]。}array。 for(i=0。i++) { pmin[i]=pA[0][i]。
點擊復制文檔內(nèi)容
職業(yè)教育相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1