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

正文內(nèi)容

軟件技術(shù)基礎(chǔ)棧和隊(duì)列上機(jī)報(bào)告-閱讀頁(yè)

2025-06-16 00:33本頁(yè)面
  

【正文】 //創(chuàng)建兩個(gè)棧公用一個(gè)以為數(shù)組空間S[m],他們的棧底分別設(shè)在一維數(shù)組的兩端。 int top1。} stacktype。 if(i==0) { out=sstack[stop1]。 return out。 stop2++。 }}int main(){ stack_type s。 =0。 printf(Please enter the fitst stack:\n)。data)amp。data!=0)//輸入元素,以0為結(jié)束 { []=data。 } 。 while(scanf(%d,amp。amp。 。 printf(The top of stack1 is:%d\n,get(0,amp。 printf(The top of stack2 is:%d\n,get(1,amp。 return 0。 has nonpointer type `stack_type39。2)問(wèn)題:輸出The top of stack1 is:5177344The top of stack2 is:346788601原因:top在輸入完成以后指向了棧頂元素的下一個(gè)解決辦法:利用top1;和top2++;來(lái)調(diào)整其指向 ex3_4:一、程序流程說(shuō)明書(shū)上第13題:創(chuàng)建一維數(shù)組Sq[m],存儲(chǔ)循環(huán)隊(duì)列的元素設(shè)立標(biāo)志tag,區(qū)分頭尾指針相同時(shí)隊(duì)列是空是滿編寫(xiě)此隊(duì)列相對(duì)應(yīng)的入隊(duì)列和出隊(duì)列函數(shù)二、程序代碼includeincludeincludedefine N 20int tag = 0。 int front, rear。//出隊(duì)函數(shù)int dequeue(queue_type *q){ int out。amp。 else { out = qdata[qfront]。 } return(out)。amp。 else { qdata[qrear]=newnum。 if(qrearqfront)tag=0。 for(i=qfront。 i=(i+1)%N) printf(%d ,qdata[i])。}int main(){ queue_type q。 =0。 printf(enter the elements of the queue:\n)。data)amp。(data!=0)) enqueue(amp。 printf(the queue is:\n)。q)。 showqueue(amp。 printf(deque:\n%d\n,dequeue(amp。 return 0。原因:主函數(shù)調(diào)用enqueue時(shí)沒(méi)有給予足夠的參數(shù),寫(xiě)成了enqueue(amp。解決辦法:將該行更改為 enqueue(amp??偨Y(jié) 有了上一次編寫(xiě)鏈表題的經(jīng)驗(yàn)以后,這次上機(jī)要順利許多。所以以后要加強(qiáng)有關(guān)方面的練習(xí)。編寫(xiě)的時(shí)候,雖然覺(jué)得順序存儲(chǔ)比較容易寫(xiě),但是鏈?zhǔn)酱鎯?chǔ)對(duì)于空間的節(jié)省讓我更加充分地充分感受到了計(jì)算機(jī)的
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1