2013软件工程数据结构实验指导书.docVIP

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
2013软件工程数据结构实验指导书2013软件工程数据结构实验指导书

给大家的实验文档中分为一下几部分 1.实验准备:其中是c++的一些内容,希望大家能借此好好复习c++。因为大家现在使用的教材是c++版本的,所以,对于c++的一些基本语法,程序的编写都需要有些了解 2.c语言实验教案中是一些c语言的基础知识,包括VC环境的使用和程序的调试,希望对c语言已经忘记的同学好好看看复习一下。(程序的编写调试是长年累月的过程,需要不断的积累,写得多了,程序调试的多了,自然就熟练了) 3.对应的flash课件:其中是一些实验的flash课件演示,给大家做一下参考 4.实验指导书和实验教案大家在做每个实验前都需要看看。阅读的时候,可以使用【视图】|【文档结构图】,可以比较自由跳到相应位置 5. 总体实验难度比较大,时间紧,单靠实验课上的几个学时,作为初学者是无法完成的,需要大家在课前课后尽自己最大的努力。 实验一 栈和队列(2学时) 实验二 多项式加减法(2学时) 实验三 迷宫(4学时) 实验四 二叉树(4学时) 实验五 图(2学时) 实验六 归并排序(2学时) Programming Project one :Application of Stack Queue 一、实验目的 通过几段代码的编写,熟悉栈和队列 二、实验内容 1、Reversing a list (必做,分3个小题目task1,task2,task3) 2、Small airport simulation(选作) 具体如下: Task 1: Compile and run the following sample application of stack from the text. You may need to make changes to the code if necessary. Write down your input and output. // Section 2.1: Reversing a List #include stack int main( ) /* Pre: The user supplies an integer n and n decimal numbers. Post: The numbers are printed in reverse order. Uses: The STL class stack and its methods */ { int n; double item; stackdouble numbers; // declares and initializes a stack of numbers cout Type in an integer n followed by n decimal numbers. endl The numbers will be printed in reverse order. endl; cin n; for (int i = 0; i n; iCC) { cin item; numbers.push(item); } cout endl endl; while (!numbers.empty( )) { cout numbers.top( ) ; numbers.pop( ); } cout endl; } Task 2: Assemble the appropriate declarations from the text into the files stack.h and stack.cpp. Make any necessary changes as re-compiling the above application Reversing a List by replacing the use of STL class stack with the use of user defined class Stack. // Section 2.2: const int maxstack = 10; // small value for testing class Stack { public: Stack(); bool empty() const; Error_code pop(); Error_code top(Stack_entry item) const; Error_code push(const Stack_entry item); private: int count; Stack_entry entry[maxstack]; }; Error_code Stack::push(const Stack_e

文档评论(0)

yyanrlund + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档