数据结构栈英文版课件.ppt

上传人:牧羊曲112 文档编号:2153923 上传时间:2023-01-20 格式:PPT 页数:57 大小:5.91MB
返回 下载 相关 举报
数据结构栈英文版课件.ppt_第1页
第1页 / 共57页
数据结构栈英文版课件.ppt_第2页
第2页 / 共57页
数据结构栈英文版课件.ppt_第3页
第3页 / 共57页
数据结构栈英文版课件.ppt_第4页
第4页 / 共57页
数据结构栈英文版课件.ppt_第5页
第5页 / 共57页
点击查看更多>>
资源描述

《数据结构栈英文版课件.ppt》由会员分享,可在线阅读,更多相关《数据结构栈英文版课件.ppt(57页珍藏版)》请在三一办公上搜索。

1、数据结构 栈 英文版,CHAPTER 2INTRODUCTION TO STACKS【学习内容】BASIC CONCEPTS1.Stack Specifications2.Implementation of Stacks3.Application:A Desk Calculator4.Application Bracket Matching5.Abstract Data Types and Theirimplementations,VocabularStack堆栈Stack Top栈顶Push stack入栈Pop stack出栈Overflow上溢出Underflow下溢出Parse解析,语

2、法分析IFO后进先出enumerated type枚举类型(C+中没讲,请查书自行补上),2.1 STACK SPECIFICATIONS2.1.1 Lists and arrays2.1.2 Stacks2.1.3 First Example:Reversing a List2.1.4 Information Hiding2.1.5 The Standard Template Library,2.1.1 Lists and ArraysDefinition a linear list is a list in whicheach element has a unique successor.

3、Array is a typical linear list structureProperty:sequential,questionRead an integer n,which will be at most25,then read a list of n numbers,and printthe list in reverse order,2.1.2 StacksDefinition A stack is a last in-first out(LIFO data structure in which all insertionand deletion are restrict to

4、one end.calledtopPop Stack Push Stackopmaxstack-bottomL,Understand stackYou can imagine stack as thisbarrel,when you want to put theblack pie into the barrel,you justput it on the top of the orangeone.Meanwhile,when you wantto get the red pie,you should firstpopup the other two pies,andthen you can

5、get the red one,2.1.3 First Example:Reversing a ListAs a simple example of the use of stacks,let uswrite a program to solve the problem of Section2.1Our program must read an integer n,followedby n floating-point numbers.It then writes themout in reverse orderWe can accomplish this task by pushing ea

6、chnumber into a stack as it is read.When the inputis finished,We pop numbers off the stack,andthey will come off in the reverse order,Pushing and popping a stack,Standard Template Library(STL)The standard template library(abbreviatedSTL in C+contains much useftinformation,many functions,and manyclas

7、sesWe can include the stl stackimplementation into our programs with thedirective#include and then we can define and initialize emptystack objects and apply methods called pushpop,top and empty,57,26、要使整个人生都过得舒适、愉快,这是不可能的,因为人类必须具备一种能应付逆境的态度。卢梭27、只有把抱怨环境的心情,化为上进的力量,才是成功的保证。罗曼罗兰28、知之者不如好之者,好之者不如乐之者。孔子29、勇猛、大胆和坚定的决心能够抵得上武器的精良。达芬奇30、意志是一个强壮的盲人,倚靠在明眼的跛子肩上。叔本华,谢谢!,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号