分治策璐 Divide and Conquer Strategy 1. Start 2准备早餐 21准备一个金枪鱼三明治 211拿来两片面包 212准备一些金枪鱼酱 22准备一些薯片 23冲一杯咖啡 3. End 2021/2/12 6/56
2021/2/12 6/56 1. Start 2.准备早餐 2.1 准备一个金枪鱼三明治 2.1.1 拿来两片面包 2.1.2 准备一些金枪鱼酱 2.2 准备一些薯片 2.3 冲一杯咖啡 3. End 分治策略 ("Divide and Conquer" Strategy )
分洽策 Divide and ConquerS爬gy) 1. Start 2准备早餐 2准备一个金枪鱼三明治 211拿来两片面包 212准备一些金枪鱼酱 22准备一些薯片 221将土豆切成片 222油炸这些土豆片 23冲一杯咖啡 3. End 2021/2/12 7/56
2021/2/12 7/56 1. Start 2.准备早餐 2.1 准备一个金枪鱼三明治 2.1.1 拿来两片面包 2.1.2 准备一些金枪鱼酱 2.2 准备一些薯片 2.2.1 将土豆切成片 2.2.2 油炸这些土豆片 2.3 冲一杯咖啡 3. End 分治策略 ("Divide and Conquer" Strategy )
分策略 ("Divide and Conquer Strategy 1. Start 2准备早餐 2准备一个金枪鱼三明治 211拿来两片面包 212准备一些金枪鱼酱 22准备一些薯片 221将土豆切成片 222油炸这些土豆片 23冲一杯咖啡 23.1烧些开水放入杯中 232在水杯中加入一些咖啡和糖 20212l23.End 8/56
2021/2/12 8/56 分治策略 ( "Divide and Conquer" Strategy ) 1. Start 2.准备早餐 2.1 准备一个金枪鱼三明治 2.1.1 拿来两片面包 2.1.2 准备一些金枪鱼酱 2.2 准备一些薯片 2.2.1 将土豆切成片 2.2.2 油炸这些土豆片 2.3 冲一杯咖啡 2.3.1 烧些开水放入杯中 2.3.2 在水杯中加入一些咖啡和糖 3. End
52算法的概念及其描述方法 面向对象程序=对象+消息 面向过程的程序=数据结构+算法 计算机中的算法( Algorithm) 为解决一个具体问题而采取的、确定的、有限的 操作步骤,仅指计算机能执行的算法 A specific and step-by-step set of instructions for carrying out a procedure or solving a problem, usually with the requirement that the procedure terminate at some point 2021/2/12 9/56
2021/2/12 9/56 5.2算法的概念及其描述方法 面向对象程序 = 对象 + 消息 面向过程的程序= 数据结构 + 算法 计算机中的算法(Algorithm ) –为解决一个具体问题而采取的、确定的、有限的 操作步骤,仅指计算机能执行的算法 – A specific and step-by-step set of instructions for carrying out a procedure or solving a problem, usually with the requirement that the procedure terminate at some point
52算法的概念及其描述方法 算法的特性 有穷性 0在合理的时间内完成 确定性,无歧义 如果x≥0,则输出Yes;如果x≤0,则输出No 有效性 0能有效执行 负数开平方 没有输入或有多个输入 有一个或多个输出 2021/2/12 1056
2021/2/12 10/56 5.2算法的概念及其描述方法 算法的特性 –有穷性 在合理的时间内完成 –确定性,无歧义 – 如果x≥0,则输出Yes;如果x≤0,则输出No –有效性 能有效执行 – 负数开平方 –没有输入或有多个输入 –有一个或多个输出