- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
算法分析与设计课件【荐】.ppt
1 The Role of Algorithms in Computing 1 what are algorithms? 2 why is the study of algorithms worthwhile? 3 what is the role of algorithms? The problem of sorting Input: sequence a1, a2, …, an of numbers. Output: permutation a‘1, a‘2, …, a‘n such that a 1 ≤ a 2 ≤ … ≤ a n . Example: 解释什么是实例? Input: 8 2 4 9 3 6 Output: 2 3 4 6 8 9 Time Is Important Homework 1.1-3, 1.1-4 1.2 Algorithms as a technology Suppose computers were infinitely fast and computer memory was free. Would you have any reason to study algorithms? Compare the running time of insert sort and merge sort. Why study algorithms andperformance? ? Algorithms help us to understand scalability. ? Performance often draws the line between what is feasible and what is impossible. ? Algorithmic mathematics provides a language for talking about program behavior. ? Performance is the currency of computing. ? The lessons of program performance generalize to other computing resources. ? Speed is fun! 2 Getting Started Analysis of Algorithms Insertion Sort Merge Sort The problem of sorting Input: sequence a1, a2, …, an of numbers. Output: permutation a‘1, a‘2, …, a‘n such that a 1 ≤ a 2 ≤ … ≤ a n . Example: Input: 8 2 4 9 3 6 Output: 2 3 4 6 8 9 An Example: Insertion Sort InsertionSort(A, n) {for i = 2 to n { key = A[i] j = i - 1; while (j 0) and (A[j] key) { A[j+1] = A[j] j = j - 1 } A[j+1] = key} } An Example: Insertion Sort InsertionSort(A, n) {for i = 2 to n { key = A[i] j = i - 1; while (j 0) and (A[j] key) { A[j+1] = A[j] j = j - 1 } A[j+1] = key} } An Example: Insertion Sort InsertionSort(A, n) {for i = 2 to n { key = A[i] j = i - 1; while (j 0) and (A[j] key) { A[j+1] = A[j] j = j - 1 } A[j+1] = key} } An Example: Insertion Sort InsertionSort(A, n) {for i = 2 to n { key = A[i] j = i - 1; while (j 0) and (A[j] key) { A[j+1] = A[j] j = j - 1 } A[j+1] = key} } An Example: Insertion Sort InsertionSort(A, n) {for i = 2 to n { key = A[i] j
您可能关注的文档
最近下载
- 俄国构成主义设计运动报告.ppt VIP
- 2025南方电网保山供电局项目制用工招聘(3人)笔试参考题库附答案解析.docx VIP
- 2025年广东省中学生天文知识竞赛试题(及答案).docx VIP
- 电镀基础知识100问.pdf VIP
- 党课:9.3纪念中国人民抗日战争暨世界反法西斯战争胜利80周年阅兵PPT课件.pptx VIP
- 高中数学--等差数列知识点归纳和习题检测.doc VIP
- 云南省2025年中考英语真题含答案.pptx VIP
- SW硅墨烯免拆模外墙保温系统工程作业指导书.docx VIP
- 2025-2026学年粤教花城版(2024)初中音乐七年级上册教学计划及进度表.docx
- 2025杭州电力设备制造有限公司招聘70人(第二批)笔试备考试题及答案解析.docx VIP
文档评论(0)