- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
(MIT经典)算法设计与分析教学课件ch05概要1
Design and Analysis of Algorithms - Chapter 5 Decrease and Conquer Reduce problem instance to smaller instance of the same problem and extend solution Solve smaller instance Extend solution of smaller instance to obtain solution to original problem Also referred to as inductive or incremental approach Examples of Decrease and Conquer Decrease by one: Insertion sort Graph search algorithms: DFS BFS Topological sorting Algorithms for generating permutations, subsets Decrease by a constant factor Binary search Fake-coin problems multiplication à la russe Josephus problem Variable-size decrease Euclid’s algorithm Selection by partition What’s the difference? Consider the problem of exponentiation: Compute an Brute Force: Divide and conquer: Decrease by one: Decrease by constant factor: Graph Traversal Many problems require processing all graph vertices in systematic fashion Graph traversal algorithms: Depth-first search Breadth-first search Depth-first search Explore graph always moving away from last visited vertex Similar to preorder tree traversals Pseudocode for Depth-first-search of graph G=(V,E) DFS(G) count :=0 mark each vertex with 0 (unvisited) for each vertex v∈ V do if v is marked with 0 dfs(v) dfs(v) count := count + 1 mark v with count for each vertex w adjacent to v do if w is marked with 0 dfs(w) Example – undirected graph Depth-first traversal: Types of edges Tree edges: edges comprising forest Back edges: edges to ancestor nodes Forward edges: edges to descendants (digraphs only) Cross edges: none of the above Example – directed graph Depth-first traversal: Depth-first search: Notes DFS can be implemented with graphs represented as: Adjacency matrices: Θ(V2) Adjacency linked lists: Θ(V+E) Yields two distinct ordering of vertices: preorder: as vertices are first encountered (pushed onto stack) postorder: as vertices become dead-ends (popped off stack) Applications: checking connectivity, finding connected components checkin
您可能关注的文档
- (2014年最新)八年级英语上册 Unit 11 Could you please clean your room _ Section A 一件人教版新目标概要1.ppt
- (2014广东版开心英语六年级上册)Unit 6 Planting Trees (第一课时)概要1.ppt
- 安恩和奶牛_概要1.ppt
- 《庐山的云雾》修改概要1.ppt
- (A2O法)6.6万立方米每天新建临淄城市污水处理厂初步设计概要1.doc
- (2125第3.2节2)桐乡市六中东校区徐登峰说题《说题—数学因你而精彩》概要1.ppt
- 《庐山的云雾》第一、二课时上课概要1.ppt
- 安惠康饮水机供应链管理战略研究-张泽英-13281150概要1.docx
- (Antonymy) 反义词概要1.ppt
- 《归去来兮辞(并序)》《滕王阁序》概要1.doc
- 《感测技术基础》(第四版)习题解答概要1.docx
- (TD)模拟题(含答案)概要1.doc
- 《弘扬宪法精神-增强法制观念》主题班会PPT概要1.ppt
- (Unit Two) 词汇学习概要1.docx
- (2015年PPT模板)华夏地理08作品_经典排版概要1.ppt
- (S)2015 南京市英语中考写作指导概要1.ppt
- 《我不能失信》ppt.ppt [自动保存的]概要1.ppt
- (Task Seven) Management of Office Daily Business(办公室日常事务管理)概要1.ppt
- (Lesson+19+A+Dinner+Date课件概要1.ppt
- 《成长莫忘父母恩》主题班会概要1.ppt
最近下载
- 人民版劳动教育四年级上册全册教学课件.ppt
- 三年级上册道德与法治课件-第一单-快乐学习-单元梳理-部编版(共28张PPT).pptx VIP
- 蛋白质工程蛋白质设计课件.ppt VIP
- Haier海尔洗衣机XQB100-M21JDB使用说明书手册参数图解图示pdf电子版下载.pdf VIP
- 提高住院患者大小便标本送检率PDCA.pptx VIP
- 2025年建设应急避难广场的可行性研究分析报告.docx
- 2025年扬中锂电铜箔项目可行性研究报告.docx
- 2025年中国注射用环磷腺苷项目创业计划书.docx
- 2025年可行性研究报告怎么写3.docx
- 2022年江苏省安全员C1证(机械安全员)考试题库大全(含答案).docx VIP
文档评论(0)