- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
北京邮电大学--计算机学院--离散数学-3.1--Algorithms.ppt
* * College of Computer Science Technology, BUPT Smallest elements “float” up to the top of the list, like bubbles in a container of liquid. Bubble Sort 30 31 1 32 33 2 34 3 30 1 31 32 2 33 3 34 1 30 31 2 32 3 33 34 1 30 2 31 3 32 33 34 1 2 30 3 31 32 33 34 1 2 3 30 31 32 33 34 * * College of Computer Science Technology, BUPT Insertion Sort Algorithm English description of algorithm: For each item in the input list, “Insert” it into the correct place in the sorted output list generated so far. Like so: Use linear or binary search to find the location where the new item should be inserted. Then, shift the items from that position onwards down by one position. Put the new item in the hole remaining. * * College of Computer Science Technology, BUPT Greedy algorithm Example 6 Consider the problem of making n cents change with quarters, dimes, nickels, and pennies, and using the least total number of coins. We can devise a greedy algorithm for making change for n cents by making a locally optimal choice at each step Lemma 1 If n is a positive integer, then n cents in change using quarters, dimes, nickels, and pennies using the fewest coins possible has at most two dimes, at most one nickel, at most four pennies, and cannot have two dimes and a nickel. The amount of change in dimes, nickels,and pennies cannot exceed 24 cents. * * College of Computer Science Technology, BUPT Theorem 1 The greedy algorithm (Algorithm 6) produces change using the fewest coins possible. * * College of Computer Science Technology, BUPT * * College of Computer Science Technology, BUPT Review §3.1: Algorithms Characteristics of algorithms. Pseudocode. Examples: Max algorithm, primality-testing, linear search binary search algorithms. Sorting. Intuitively we see that binary search is much faster than linear search, but how do we analyze the efficiency of algorithms formally? Use methods of algorithmic complexity, which utilize the order-of-growth concepts from §3.2 * * College of Comp
您可能关注的文档
- 五大宪章.ppt
- 人工智能-许建华--南京师范大学计算机科学系-4.5遗传算法.ppt
- 人教新课标数学五年级下册《整数加法运算定律推广到分数加法》课件.ppt
- 人教版三年级上册数学第四单元-万以内的减法课件.ppt
- 人教版五下数学分数加减混合运算第三课时.pptx
- 人教版数学七年级上册-有理数加法运算律.pptx
- 人教版数学六年级上册第四章《圆的面积》课件.ppt
- 代数结构-离散数学.ppt
- 仿真科学讲课用.ppt
- 优化方案2017高中数学第一章解三角形1.2应用举例第2课时三角形中的几何计算课件新人教A版必修5.ppt
- 北京邮电大学--计算机学院--离散数学-3.3-Complexity-of-algorithm.ppt
- 北京邮电大学计算机学院--离散数学---数学结构-解码-chap11-2.ppt
- 北京邮电大学计算机学院--离散数学--9.1-9.3-relations.ppt
- 北京邮电大学计算机学院--离散数学--数学结构--群论-chap9-2.ppt
- 北京邮电大学计算机学院--离散数学-10.1-10.2-graphs.ppt
- 北京邮电大学计算机学院--离散数学-11.1-trees.ppt
- 北京邮电大学计算机学院--离散数学-11.3-11.4trees.ppt
- 北化研究生数理统计2-3.ppt
- 北师大版六年级数学上册《分数混合运算三》课件.ppt
- 北师大版小学五年级下册数学《分数混合运算一》课件.ppt
最近下载
- 中医院药剂招聘笔试题和部分参考答案5套 .pdf VIP
- 第17课 辛亥革命与中华民国的建立 教案-2023-2024学年中职高一上学期高教版(2023)中国历史全一册.docx VIP
- 院感防控与手卫生管理规范.pptx VIP
- 《DB44T 2583-2024无人水面艇和小型智能船舶海上测试管理规范》.docx VIP
- JGJ162-2008建筑施工模板安全技术规程.docx VIP
- 富士达各功能电梯地址码(1)(1).pdf VIP
- 07K102 风阀选用与安装.pdf
- 海藻学-第四章-红藻门.ppt VIP
- 2025年人教版高中物理书目录(全).pdf VIP
- 合肥市庐江县选调县外教师考试真题2024 .pdf
文档评论(0)