- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
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. EXAMPLE We want to develop an algorithm for finding the largest integer among a list of positive integers. The algorithm should find the largest integer among a list of integers of any value(5,1000,10,000,1,000,000,etc.) . The algorithm should be general and not depend on the number of integers. To solve this problem, you need an intuitive approach . First use a small number of integers( e.g., five) and then extend the solution to any number of integers. We call the algorithm FindLargest. Each algorithm has a name to distinguish it from other algorithms. The algorithm receives a list of five integers ( as input ) and gives the largest integer as output. Input The algorithm accepts the list of five integer as input. Processing The algorithm uses the following five steps to find the largest integer. STEP 1 In this step, the algorithm inspect the first integer (12). Since it has not handled the rest of the integers yet, it decides that the largest integer (so far) is the first integer. The algorithm defines a data item , called Largest, and sets its value to the first integer (12). STEP 2 The largest integer so far is 12, but the new number may change the situation. The algorithm makes a compa-rison between the value of largest (12) and the value of the second integer (8). It finds that Largest is larger than the second integer, which means that Largest is still holding the largest integer. There is no need to change the value of largest. STEP 3 The largest integer so far is 12, but the new number (13) is larger than Largest. This means that the value of Largest is no longer valid. The value of Largest should be replace
您可能关注的文档
- 延边大学管理学原理课件 沟通.ppt
- 延边大学管理学原理课件 管理道德与企业社会责任.ppt
- 延边大学管理学原理课件 管理活动与管理理论.ppt
- 延边大学管理学原理课件 激励.ppt
- 延边大学管理学原理课件 计划与计划工作.ppt
- 延边大学管理学原理课件 节领导的内涵.ppt
- 延边大学管理学原理课件 决策与决策方法.ppt
- 延边大学管理学原理课件 控制方法.ppt
- 延边大学管理学原理课件 控制与控制过程.ppt
- 延边大学管理学原理课件 领导风格类型.ppt
- 云南农业大学计算机导论课件Chapter9 Programming Languages.ppt
- 云南农业大学计算机导论课件Chapter10 Software Engineering.ppt
- 云南农业大学计算机导论课件Chapter11 Data Structures.ppt
- 云南农业大学计算机导论课件Chapter12 Abstract Data Type.ppt
- 云南农业大学计算机导论课件Chapter13 File Structures.ppt
- 云南农业大学计算机导论课件Chapter14 Databases.ppt
- 云南农业大学计算机网络基础课件Chapter1 Network Fundamentals.ppt
- 云南农业大学计算机网络基础课件Chapter2 Network Fundamentals.ppt
- 云南农业大学计算机网络基础课件Chapter3 Network Fundamentals.ppt
- 云南农业大学计算机网络基础课件Chapter4 Network Fundamentals.ppt
文档评论(0)