- 1、本文档共107页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
pseudocode伪代码-天津大学计算机科学与技术学院
8.1 CONCEPT INFORMAL DEFINITION Algorithm(算法): a step-by-step method for solving a problem or doing a task.(逐步解决问题或完成任务的方法) In this definition, an algorithm is independent of the computer system(独立于计算机系统). More specifically, we should also note that the algorithm accepts a list of input data and creates a list of output data.(输入一组数据,产生一组输出数据) Input The algorithm accepts the list of five integer as input. Processing The algorithm uses five steps to find the largest integer. Output Because there are no more integers to be processed, the algorithm outputs the value of Largest, which is 13. DEFINING ACTIONS REFINEMENT GENERALIZATION 8.2 THREE CONSTRUCTS 8.3 ALGORITHM REPRESENTATION FLOWCHART(流程图) A flowchart is a pictorial representation of an algorithm. It shows how the algorithm flows from beginning to end. PSEUDOCODE(伪代码) Pseudocode is an Englishlike representation of an algorithm. It is part English and part structured code.(类似英语的表示方法) 8.4 MORE FORMAL DEFINITION Algorithm: an ordered set of unambiguous steps that produces a result and terminates in a finite time(一组明确步骤的有序集合,它产生结果并在有限时间内终止). ORDERED SET(有序集合) An algorithm must be a well-defined, ordered set of instruction. UNAMBIGUOUS STEPS (明确步骤) Each algorithm must be clearly and unambiguously defined. PRODUCE A RESULT (产生结果) An algorithm must produce a result; otherwise, it is useless. The result can be data that are returned to the calling algorithm or same other effect (e.g., printing). TERMINATE IN A FINITE TIME(在有限时间内终止)An algorithm must terminate (halt). If it does not (e.g., has an infinite loop), you have not created an algorithm. 8.5 SUBALGORITHMS(子算法) The principles of structured programming, require that an algorithm be broken into small units called subalgorithms (the terms subprograms, subroutines, procedures, function, methods, and modules are also used). Each subalgorithm is in turn divided into smaller subalgorit
您可能关注的文档
最近下载
- 2024年新高考化学命题特点及江西卷试题分析.pptx
- 县区域水土保持评估实施细则.docx
- (医学课件)PICC维护课件.ppt
- 第四单元 三国两晋南北朝时期:政权分立与民族交融 教学设计 2023-2024学年统编版七年级历史上册.docx
- Unit 2 Different families 单元整体(教学设计)-2024-2025学年人教PEP版(2024)英语三年级上册.docx
- 2024煤矿安全生产标准化管理体系解读.docx VIP
- 算法设计与分析 第2版 第9章-图算法设计.ppt
- 标准化服务在政务服务中的应用考核试卷.docx
- 2023年《全日制普通高中物理新课程标准》.pdf
- 人教PEP三年级英语上册《Unit1 Making friends part A》课件.pptx VIP
文档评论(0)