{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

03-Divide-and-Conquer

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

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

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

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

View Full Document
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.
Algorithms L2.3 Merge sort 1. Divide: Trivial. 2. Conquer: Recursively sort 2 subarrays. 3. Combine: Linear-time merge.

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

View Full Document
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
Algorithms L2.5 Master theorem (reprise) T ( n ) = a T ( n / b ) + f ( n ) C ASE 1 : f ( n ) = O ( n ) , constant ε > 0

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

View Full Document
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
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.

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

View Full Document
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.
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.

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

View Full Document
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.
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.

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

View Full Document
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:
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online