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

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

View Full Document Right Arrow Icon
CSE 421 Algorithms Richard Anderson Lecture 13 Divide and Conquer
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
T(n) = aT(n/b) + n c Balanced: a = b c Increasing: a > b c Decreasing: a < b c
Background image of page 3

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

View Full DocumentRight Arrow Icon
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)
Background image of page 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
Background image of page 5

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

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

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

View Full DocumentRight Arrow Icon
Image of page 8
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 Right Arrow Icon
Ask a homework question - tutors are online