# Lecture13 - CSE 421 Algorithms Richard Anderson Lecture 13...

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

CSE 421 Algorithms Richard Anderson Lecture 13 Divide and Conquer

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

View Full Document
What you really need to know about recurrences Work per level changes geometrically with the level Geometrically increasing (x > 1) The bottom level wins Geometrically decreasing (x < 1) The top level wins Balanced (x = 1) Equal contribution
T(n) = aT(n/b) + n c Balanced: a = b c Increasing: a > b c Decreasing: a < b c

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

View Full Document
Classify the following recurrences (Increasing, Decreasing, Balanced) T(n) = n + 5T(n/8) T(n) = n + 9T(n/8) T(n) = n 2 + 4T(n/2) T(n) = n 3 + 7T(n/2) T(n) = n 1/2 + 3T(n/4)
Divide and Conquer Algorithms Split into sub problems Recursively solve the problem Combine solutions Make progress in the split and combine stages Quicksort – progress made at the split step Mergesort – progress made at the combine step

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

View Full Document
Closest Pair Problem Given a set of points find the pair of points p, q that minimizes dist(p, q)
Divide and conquer If we solve the problem on two subsets, does it help? (Separate by median x coordinate) δ 1 δ 2

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/25/2012 for the course CSE 421 taught by Professor Richardanderson during the Fall '06 term at University of Washington.

### Page1 / 19

Lecture13 - CSE 421 Algorithms Richard Anderson Lecture 13...

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

View Full Document
Ask a homework question - tutors are online