麻省理工学院:《算法导论》(英文版) Lecture 3 Prof erik demaine

Introduction to algorithms 6.046J/18.401J/SMA5503 Lecture 3 Prof erik demaine
Introduction to Algorithms 6.046J/18.401J/SMA5503 Lecture 3 Prof. Erik Demaine

The divide-and-conquer design paradigm 1. Divide the problem(instance) into subproblems 2. Conquer the subproblems by solving them recursively 3. Combine subproblem solutions Day 4 Introduction to Algorithms L3.2
Day 4 Introduction to Algorithms L3.2 The divide-and-conquer design paradigm 1. Divide the problem (instance) into subproblems. 2. Conquer the subproblems by solving them recursively. 3. Combine subproblem solutions

Example: merge sort 1 Divide: trivial 2. Conquer. recursively sort 2 subarrays 3. Combine: Linear-time merge 7(n)=2(m2)+O(m) subproblems work dividing and combining subproblem size Day 4 Introduction to Algorithms L3.3
Day 4 Introduction to Algorithms L3.3 Example: merge sort 1. Divide: Trivial. 2. Conquer: Recursively sort 2 subarrays. 3. Combine: Linear-time merge. T(n) = 2 T(n/2) + O(n) # subproblems subproblem size work dividing and combining

Master theorem(reprise) 7(n)=a(m/b)+f(n) CASE 1: f(n)=O(nlogba-E →(n)=(n0g) CASE 2: f(n)=o(nlogbalgkn →7(n)=( logba Ig+ln) CASE 3: f (n)=92(noga+a)and af(n/b)scf(n) →7(m)=((n) Merge sort: a=2, 6=2= noga=n →CASE2(k=0)→7m)=mnln) Day 4 Introduction to Algorithms
Day 4 Introduction to Algorithms L3.4 Master theorem (reprise) T(n) = a T(n/b) + f(n) CASE 1: f(n) = O(nlogba – ε) ⇒ T(n) = Θ(nlogba) . CASE 2: f(n) = Θ(nlogba lgkn) ⇒ T(n) = Θ(nlogba lgk+1n) . CASE 3: f(n) = Ω(nlogba + ε) and a f(n/b) ≤ c f(n) ⇒ T(n) = Θ(f(n)) . Merge sort: a = 2, b = 2 ⇒ nlogba = n ⇒ CASE 2 (k = 0) ⇒ T(n) = Θ(n lg n)

Binary search Find an element in a sorted array 1 Divide: check middle element 2. Conquer: Recursively search I subarray 3. Combine. trivial Example: find 9 357891215 Day 4 Introduction to Algorithms L3.5
Day 4 Introduction to Algorithms L3.5 Binary search Example: Find 9 3 5 7 8 9 12 15 Find an element in a sorted array: 1. Divide: Check middle element. 2. Conquer: Recursively search 1 subarray. 3. Combine: Trivial

Binary search Find an element in a sorted array 1 Divide: check middle element 2. Conquer: Recursively search I subarray 3. Combine. trivial Example: find 9 357891215 Day 4 Introduction to Algorithms L36
Day 4 Introduction to Algorithms L3.6 Binary search Example: Find 9 3 5 7 8 9 12 15 Find an element in a sorted array: 1. Divide: Check middle element. 2. Conquer: Recursively search 1 subarray. 3. Combine: Trivial

Binary search Find an element in a sorted array 1 Divide: check middle element 2. Conquer: Recursively search I subarray 3. Combine. trivial Example: find 9 357891215 Day 4 Introduction to Algorithms L3.7
Day 4 Introduction to Algorithms L3.7 Binary search Example: Find 9 3 5 7 8 9 12 15 Find an element in a sorted array: 1. Divide: Check middle element. 2. Conquer: Recursively search 1 subarray. 3. Combine: Trivial

Binary search Find an element in a sorted array 1 Divide: check middle element 2. Conquer: Recursively search I subarray 3. Combine. trivial Example: find 9 357891215 Day 4 Introduction to Algorithms L3.8
Day 4 Introduction to Algorithms L3.8 Binary search Example: Find 9 3 5 7 8 9 12 15 Find an element in a sorted array: 1. Divide: Check middle element. 2. Conquer: Recursively search 1 subarray. 3. Combine: Trivial

Binary search Find an element in a sorted array 1 Divide: check middle element 2. Conquer: Recursively search I subarray 3. Combine. trivial Example: find 9 357891215 Day 4 Introduction to Algorithms
Day 4 Introduction to Algorithms L3.9 Binary search Example: Find 9 3 5 7 8 9 12 15 Find an element in a sorted array: 1. Divide: Check middle element. 2. Conquer: Recursively search 1 subarray. 3. Combine: Trivial

Binary search Find an element in a sorted array 1 Divide: check middle element 2. Conquer: Recursively search I subarray 3. Combine. trivial Example: find 9 357891215 Day 4 Introduction to Algorithms L3.10
Day 4 Introduction to Algorithms L3.10 Binary search Find an element in a sorted array: 1. Divide: Check middle element. 2. Conquer: Recursively search 1 subarray. 3. Combine: Trivial. Example: Find 9 3 5 7 8 9 12 15
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 麻省理工学院:《算法导论》(英文版) Lecture 2 Prof erik demaine.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture Prof. Charles E. Leiserson.pdf
- 桂林电子科技大学:《可编程ASIC原理》课程教学资源(实验指导书)实验二 波形输入与仿真实现.pdf
- 桂林电子科技大学:《可编程ASIC原理》课程教学资源(实验指导书)综合、设计性实验指导书.pdf
- 桂林电子科技大学:《可编程ASIC原理》课程教学资源(实验指导书)封面.pdf
- 桂林电子科技大学:《可编程ASIC原理》课程教学资源(实验指导书)附录GW48EDA系统使用说明.pdf
- 桂林电子科技大学:《可编程ASIC原理》课程教学资源(实验指导书)实验一 可编程ASIC使用初步.pdf
- 桂林电子科技大学:《可编程ASIC原理》课程教学资源(实验指导书)实验五 A/D采样电路设计.pdf
- 桂林电子科技大学:《可编程ASIC原理》课程教学资源(实验指导书)实验四 只读存储器设计.pdf
- 桂林电子科技大学:《可编程ASIC原理》课程教学资源(实验指导书)实验三 序列信号发生器与序列信号检测器的设计.pdf
- 桂林电子科技大学:《可编程ASIC原理》课程教学资源(实验指导书)实验六 数字电压表设计.pdf
- 《数字平面艺术设计》课程教学资源(试卷习题)试题库.doc
- 华中科技大学:《MATLAB语言与控制系统仿真》课程教学资源(PPT课件讲稿)第四章 控制系统的分析方法.ppt
- 华中科技大学:《MATLAB语言与控制系统仿真》课程教学资源(PPT课件讲稿)第五章 SIMULINK仿真基础.ppt
- 华中科技大学:《MATLAB语言与控制系统仿真》课程教学资源(PPT课件讲稿)第二章 matlab语言基础.ppt
- 华中科技大学:《MATLAB语言与控制系统仿真》课程教学资源(PPT课件讲稿)第三章 控制系统的数学描述与建模.ppt
- 华中科技大学:《MATLAB语言与控制系统仿真》课程教学资源(PPT课件讲稿)第一章 计算机辅助设计与仿真技术概述.ppt
- 沈阳师范大学:《数据库应用基础》应试指导.ppt
- 沈阳师范大学:《数据库应用基础》课堂测试.ppt
- 沈阳师范大学:《数据库应用基础》第12章 数据库应用.ppt
- 麻省理工学院:《算法导论》(英文版)Lecture 4 Prof. charles e. leiserson.pdf
- 麻省理工学院:《算法导论》(英文版)Lecture 5 Prof erik demaine.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 6 Prof erik demaine.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 7 Prof charles e. leiserson.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 8 Prof charles e. leiserson.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 9 Prof charles e. leiserson.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 10 Prof erik demaine.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 11 Prof erik demaine.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 12 Prof erik demaine.pdf
- 麻省理工学院:《算法导论》(英文版)Lecture 13 Prof erik demaine.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 14 Prof charles e. leiserson.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 15 Prof charles e. leiserson.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 16 Prof charles e. leiserson.pdf
- 麻省理工学院:《算法导论》(英文版)Lecture 17 Prof erik demaine.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 18 Prof erik demaine.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 19 Prof erik demaine.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 20 Prof erik demaine.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 21 Prof charles e. leiserson.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 22 Prof charles e. leiserson.pdf
- 麻省理工学院:《算法导论》(英文版) Lecture 23 Prof charles e. leiserson.pdf