Lecture12 - CSE 421 Algorithms Richard Anderson Lecture 12...

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 12 Recurrences and 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
Divide and Conquer
Background image of page 2
Recurrence Examples T(n) = 2 T(n/2) + cn O(n log n) T(n) = T(n/2) + cn O(n) More useful facts: – log k n = log 2 n / log 2 k k log n = n log k
Background image of page 3

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

View Full DocumentRight Arrow Icon
T(n) = aT(n/b) + f(n)
Background image of page 4
Recursive Matrix Multiplication Multiply 2 x 2 Matrices: | r s | | a b| |e g| | t u| | c d| | f h| r = ae + bf s = ag + bh t = ce + df u = cg + dh A N x N matrix can be viewed as a 2 x 2 matrix with entries that are (N/2) x (N/2) matrices. The recursive matrix multiplication algorithm recursively multiplies the (N/2) x (N/2) matrices and combines them using the equations for multiplying 2 x 2 matrices =
Background image of page 5

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

View Full DocumentRight Arrow Icon
Recursive Matrix Multiplication How many recursive calls are made at each level? How much work in combining the results? What is the recurrence?
Background image of page 6
Matrix Multiplication Algorithm? Recurrence:
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 / 17

Lecture12 - CSE 421 Algorithms Richard Anderson Lecture 12...

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