




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
數(shù)據(jù)結(jié)構(gòu)棧英文版數(shù)據(jù)結(jié)構(gòu)棧英文版1CHAPTER2INTRODUCTIONTOSTACKS【學(xué)習(xí)內(nèi)容】BASICCONCEPTS1.StackSpecifications2.ImplementationofStacks3.Application:ADeskCalculator4.ApplicationBracketMatching5.AbstractDataTypesandTheirimplementationsCHAPTER22VocabularStack堆棧StackTop棧頂Pushstack入棧Popstack出棧Overflow上溢出Underflow下溢出Parse解析,語法分析IFO后進(jìn)先出enumeratedtype枚舉類型(C++中沒講,請查書自行補(bǔ)上)Vocabular32.1STACKSPECIFICATIONS2.1.1Listsandarrays2.1.2Stacks2.1.3FirstExample:ReversingaList2.1.4InformationHiding2.1.5TheStandardTemplateLibrary2.1STACKSPECIFICATIONS42.1.1ListsandArraysDefinitionalinearlistisalistinwhicheachelementhasauniquesuccessor.ArrayisatypicallinearliststructureProperty:sequential2.1.1ListsandArrays5questionReadanintegern,whichwillbeatmost25,thenreadalistofnnumbers,andprintthelistinreverseorderquestion62.1.2StacksDefinitionAstackisalastin-firstout(LIFOdatastructureinwhichallinsertionanddeletionarerestricttooneend.calledtopPopStackPushStackopmaxstack-bottomL2.1.2Stacks7UnderstandstackYoucanimaginestackasthisbarrel,whenyouwanttoputtheblackpieintothebarrel,youjustputitonthetopoftheorangeone.Meanwhile,whenyouwanttogettheredpie,youshouldfirstpopuptheothertwopies,andthenyoucangettheredoneUnderstandstack82.1.3FirstExample:ReversingaListAsasimpleexampleoftheuseofstacks,letuswriteaprogramtosolvetheproblemofSection2.1Ourprogrammustreadanintegern,followedbynfloating-pointnumbers.ItthenwritesthemoutinreverseorderWecanaccomplishthistaskbypushingeachnumberintoastackasitisread.Whentheinputisfinished,Wepopnumbersoffthestack,andtheywillcomeoffinthereverseorder2.1.3FirstExample:Reversing9PushingandpoppingastackPushingandpoppingastack10StandardTemplateLibrary(STL)Thestandardtemplatelibrary(abbreviatedSTLinC++containsmuchuseftinformation,manyfunctions,andmanyclassesWecanincludethestlstackimplementationintoourprogramswiththedirective#include<stack>andthenwecandefineandinitializeemptystackobjectsandapplymethodscalledpushpop,topandemptyStandardTemplateLibrary(STL11數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件12數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件13數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件14數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件15數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件16數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件17數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件18數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件19數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件20數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件21數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件22數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件23數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件24數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件25數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件26數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件27數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件28數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件29數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件30數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件31數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件32數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件33數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件34數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件35數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件36數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件37數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件38數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件39數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件40數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件41數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件42數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件43數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件44數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件45數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件46數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件47數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件48數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件49數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件50數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件51數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件52數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件53數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件54數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件55數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件5626、要使整個(gè)人生都過得舒適、愉快,這是不可能的,因?yàn)槿祟惐仨毦邆湟环N能應(yīng)付逆境的態(tài)度?!R梭
27、只有把抱怨環(huán)境的心情,化為上進(jìn)的力量,才是成功的保證?!_曼·羅蘭
28、知之者不如好之者,好之者不如樂之者。——孔子
29、勇猛、大膽和堅(jiān)定的決心能夠抵得上武器的精良?!_(dá)·芬奇
30、意志是一個(gè)強(qiáng)壯的盲人,倚靠在明眼的跛子肩上?!灞救A謝謝!5726、要使整個(gè)人生都過得舒適、愉快,這是不可能的,因?yàn)槿祟惐財(cái)?shù)據(jù)結(jié)構(gòu)棧英文版數(shù)據(jù)結(jié)構(gòu)棧英文版58CHAPTER2INTRODUCTIONTOSTACKS【學(xué)習(xí)內(nèi)容】BASICCONCEPTS1.StackSpecifications2.ImplementationofStacks3.Application:ADeskCalculator4.ApplicationBracketMatching5.AbstractDataTypesandTheirimplementationsCHAPTER259VocabularStack堆棧StackTop棧頂Pushstack入棧Popstack出棧Overflow上溢出Underflow下溢出Parse解析,語法分析IFO后進(jìn)先出enumeratedtype枚舉類型(C++中沒講,請查書自行補(bǔ)上)Vocabular602.1STACKSPECIFICATIONS2.1.1Listsandarrays2.1.2Stacks2.1.3FirstExample:ReversingaList2.1.4InformationHiding2.1.5TheStandardTemplateLibrary2.1STACKSPECIFICATIONS612.1.1ListsandArraysDefinitionalinearlistisalistinwhicheachelementhasauniquesuccessor.ArrayisatypicallinearliststructureProperty:sequential2.1.1ListsandArrays62questionReadanintegern,whichwillbeatmost25,thenreadalistofnnumbers,andprintthelistinreverseorderquestion632.1.2StacksDefinitionAstackisalastin-firstout(LIFOdatastructureinwhichallinsertionanddeletionarerestricttooneend.calledtopPopStackPushStackopmaxstack-bottomL2.1.2Stacks64UnderstandstackYoucanimaginestackasthisbarrel,whenyouwanttoputtheblackpieintothebarrel,youjustputitonthetopoftheorangeone.Meanwhile,whenyouwanttogettheredpie,youshouldfirstpopuptheothertwopies,andthenyoucangettheredoneUnderstandstack652.1.3FirstExample:ReversingaListAsasimpleexampleoftheuseofstacks,letuswriteaprogramtosolvetheproblemofSection2.1Ourprogrammustreadanintegern,followedbynfloating-pointnumbers.ItthenwritesthemoutinreverseorderWecanaccomplishthistaskbypushingeachnumberintoastackasitisread.Whentheinputisfinished,Wepopnumbersoffthestack,andtheywillcomeoffinthereverseorder2.1.3FirstExample:Reversing66PushingandpoppingastackPushingandpoppingastack67StandardTemplateLibrary(STL)Thestandardtemplatelibrary(abbreviatedSTLinC++containsmuchuseftinformation,manyfunctions,andmanyclassesWecanincludethestlstackimplementationintoourprogramswiththedirective#include<stack>andthenwecandefineandinitializeemptystackobjectsandapplymethodscalledpushpop,topandemptyStandardTemplateLibrary(STL68數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件69數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件70數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件71數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件72數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件73數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件74數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件75數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件76數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件77數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件78數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件79數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件80數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件81數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件82數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件83數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件84數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件85數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件86數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件87數(shù)據(jù)結(jié)構(gòu)-棧-英文版課件
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 網(wǎng)絡(luò)游戲服務(wù)器測試機(jī)柜租賃與設(shè)備升級服務(wù)合同
- 建筑工程知識產(chǎn)權(quán)許可與侵權(quán)糾紛解決協(xié)議
- 工業(yè)廠房門窗加固與高效密封系統(tǒng)建設(shè)協(xié)議
- 展商參展安全責(zé)任協(xié)議及風(fēng)險(xiǎn)預(yù)防
- 抖音短視頻內(nèi)容創(chuàng)作者內(nèi)容審核規(guī)范協(xié)議
- 生物質(zhì)能源專利技術(shù)轉(zhuǎn)移及項(xiàng)目實(shí)施合作協(xié)議
- 鄉(xiāng)村振興基金份額分割及贖回操作協(xié)議
- 網(wǎng)絡(luò)直播設(shè)備采購、升級與全面維護(hù)服務(wù)協(xié)議
- 礦產(chǎn)投資顧問合同(含礦產(chǎn)資源投資咨詢與實(shí)施)
- 消防安全教材版權(quán)授權(quán)合作框架協(xié)議
- 達(dá)美樂比薩線上整合營銷規(guī)劃方案
- 水泥產(chǎn)品生產(chǎn)許可證實(shí)施細(xì)則
- 德意志意識形態(tài)
- YY/T 1778.1-2021醫(yī)療應(yīng)用中呼吸氣體通路生物相容性評價(jià)第1部分:風(fēng)險(xiǎn)管理過程中的評價(jià)與試驗(yàn)
- GB/T 20041.21-2008電纜管理用導(dǎo)管系統(tǒng)第21部分:剛性導(dǎo)管系統(tǒng)的特殊要求
- GB/T 14054-1993輻射防護(hù)用固定式X、γ輻射劑量率儀、報(bào)警裝置和監(jiān)測儀
- 《馬克思主義發(fā)展史》第六章 毛澤東思想是馬克思主義在中國發(fā)展的第一個(gè)重大成果
- 粵教版地理七年級下冊全冊課件
- 工商企業(yè)管理專業(yè)模擬實(shí)訓(xùn)報(bào)告
- 八年級英語15篇完形填空(附答案)
- 會(huì)寶嶺選礦廠集中控制技術(shù)方案
評論
0/150
提交評論