《计算机科学导论》(第三版)第08章.ppt
《《计算机科学导论》(第三版)第08章.ppt》由会员分享,可在线阅读,更多相关《《计算机科学导论》(第三版)第08章.ppt(40页珍藏版)》请在三一办公上搜索。
1、1.1,1.2,Objectives:,1.3,Objectives(continued):,1.4,8.1 Concept,In this section we informally define an algorithm and elaborate on the concept using an example.,1.5,Figure 8.1:Informal definition of an algorithm,1.6,Figure 8.2:Finding the largest integer among five integers,1.7,Figure 8.3:Defining ac
2、tions in FindLargest algorithm,1.8,Figure 8.4:FindLargest refined,1.9,Figure 8.5:Generalization of FindLargest,1.10,8.2 Three constructs,Computer scientists have defined three constructs for a structured program or algorithm.The idea is that a program must be made of a combination of only these thre
3、e constructs:sequence,decision(selection),and repetition.It has been proven there is no need for any other constructs.Using only these constructs makes a program or an algorithm easy to understand,debug,or change.,1.11,Figure 8.6:Three constructs,1.12,8.3 Algorithm Representation,So far,we have used
4、 figures to convey the concept of an algorithm.During the last few decades,tools have been designed for this purpose.Two of these tools,UML and pseudocode,are presented here.,1.13,Figure 8.7:UML for three constructs,1.14,Figure 8.8:Pseudocode for three constructs,1.15,Algorithm 8.1:Calculating the s
5、um of two integers:,1.16,Algorithm 8.2:Assigning pass/no pass grade:,1.17,Algorithm 8.3:Assigning a letter grade:,1.18,Algorithm 8.4:Finding the largest integer:,1.19,Algorithm 8.5:Find the smallest integers among 1000:,1.20,8.4 A More Formal Definition,Now that we have discussed the concept of an a
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机科学导论 计算机科学 导论 第三 08
链接地址:https://www.31ppt.com/p-5051854.html