- 1、本文档共67页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Prof. Amr Goneid, AUC * (d) Complexity Analysis Skeletal Algorithm: for j = 1 to n-1 do { // sub-tree has j+1 nodes for i = 1 to n-j do { // for each of the n-j sub-tree combinations for k = i to i+j do { find cost of each of the j+1 configurations and determine minimum cost } } } T(n) = ?1? j ? n-1 ( j + 1) (n – j) = O(n3) , S(n) = O(n2) Prof. Amr Goneid, AUC * Exercise Find the optimal binary search tree for the following words with the associated frequencies: a (18) , and (22) , I (19) , it (20) , or (21) Answer: Min cost = 20 + 2*43 + 3*37 = 217 it or and I a 20 22 21 18 19 Prof. Amr Goneid, AUC * 9. Dynamic Programming Algorithms for Graph Problems Various optimization graph problems have been solved using Dynamic Programming algorithms. Examples are: Dijkstras algorithm solves the single-source shortest path problem for a graph with nonnegative edge path costs Floyd–Warshall algorithm for finding all pairs shortest paths in a weighted graph (with positive or negative edge weights) and also for finding transitive closure The Bellman–Ford algorithm computes single-source shortest paths in a weighted digraph for graphs with negative edge weights. These will be discussed later under “Graph Algorithms”. Prof. Amr Goneid, AUC * 10. Comparison with Greedy and Divide Conquer Methods Greedy vs. DP : Both are optimization techniques, building solutions from a collection of choices of individual elements. The greedy method computes its solution by making its choices in a serial forward fashion, never looking back or revising previous choices. DP computes its solution bottom up by synthesizing them from smaller subsolutions, and by trying many possibilities and choices before it arrives at the optimal set of choices. There is no a priori test by which one can tell if the Greedy method will lead to an optimal solution. By contrast, ther
您可能关注的文档
- Dokumentation der individuellen 个人文件 Gymnasium .ppt
- Domain Name System Computer Science at RPI域名系统在RPI计算机科学.ppt
- Domains of Learning EdPsyc Interactive域的学习edpsyc互动.ppt
- DISP2003 Introduction to Digital Signal Processingdisp2003介绍数字信号处理.ppt
- Doing Business in China Texas Association of 在中国做生意德克萨斯协会.ppt
- DON'T WORRY, BE HAPPY musicbulletinboards别担心要快乐 musicbulletinboards.net.ppt
- DOMESTIC ANIMALS bglog国内动物bglog.net.ppt
- Donation Championship Teams The Physician Champion捐赠冠军队的医生冠军.ppt
- Dollar General Balloon Program Balloons美元通用气球计划气球 .ppt
- Don‘t worry be happy Amazon Web Services不要担心快乐亚马逊网络服务.ppt
最近下载
- 韦氏学龄前及初小儿童智力测验量表完整版 .pdf VIP
- 鄂教版六年级的心理健康胜不骄败不馁(教案).doc
- GB_T 25283-2023 矿产资源综合勘查评价规范.docx
- 2024年高考-物理考试历年全考点试卷附带答案.docx VIP
- 《GBT 25283-2023矿产资源综合勘查评价规范》必威体育精装版解读.pptx
- 传统文化视域下儿童绘本的艺术语言解读.docx VIP
- 兰新高铁无线移动通信覆盖方案设计与实现-电子与通信工程专业论文.docx
- 绘本创作——以《花灯》为例.doc VIP
- 老年牙病ppt课件.ppt
- 2024年天津高考物理试题复习考点分类汇总(6个必考).pdf VIP
文档评论(0)