03-Divide-and-Conquer

03-Divide-and-Conquer - Algorithms LECTURE 3 Divide and...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Algorithms L2.1 Algorithms Professor Ashok Subramanian L ECTURE 3 Divide and Conquer Binary search Powering a number Fibonacci numbers Matrix multiplication Strassen’s algorithm VLSI tree layout
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Algorithms L2.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.
Background image of page 2
Algorithms L2.3 Merge sort 1. Divide: Trivial. 2. Conquer: Recursively sort 2 subarrays. 3. Combine: Linear-time merge.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Algorithms L2.4 Merge sort 1. Divide: Trivial. 2. Conquer: Recursively sort 2 subarrays. 3. Combine: Linear-time merge. T ( n ) = 2 T ( n /2) + Θ ( n ) # subproblems subproblem size work dividing and combining
Background image of page 4
Algorithms L2.5 Master theorem (reprise) T ( n ) = a T ( n / b ) + f ( n ) C ASE 1 : f ( n ) = O ( n ) , constant ε > 0
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Algorithms L2.6 Master theorem (reprise) T ( n ) = a T ( n / b ) + f ( n ) C ASE 1 : f ( n ) = O ( n ) , constant ε > 0 Merge sort: a = 2 , b = 2 n = n = n
Background image of page 6
Algorithms L2.7 Binary search Find an element in a sorted array: 1. Divide: Check middle element. 2. Conquer: Recursively search 1 subarray. 3. Combine: Trivial.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Algorithms L2.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.
Background image of page 8
Algorithms L2.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.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Algorithms L2.10 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.
Background image of page 10
Algorithms L2.11 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.
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
L2.12 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:
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 54

03-Divide-and-Conquer - Algorithms LECTURE 3 Divide and...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online