CS 3343 – Fall 2011
More Divide & Conquer
Carola Wenk Slides courtesy of Charles Leiserson with small
9/20/11 CS 3343 Analysis of Algorithms 1
More Divide & Conquer Carola Wenk Slides courtesy of Charles - - PowerPoint PPT Presentation
CS 3343 Fall 2011 More Divide & Conquer Carola Wenk Slides courtesy of Charles Leiserson with small Slides courtesy of Charles Leiserson with small changes by Carola Wenk 9/20/11 CS 3343 Analysis of Algorithms 1 Powering a number
9/20/11 CS 3343 Analysis of Algorithms 1
9/20/11 CS 3343 Analysis of Algorithms 2
9/20/11 CS 3343 Analysis of Algorithms 3
9/20/11 CS 3343 Analysis of Algorithms 4
4
3 4 5
2 6
1
9/20/11 CS 3343 Analysis of Algorithms 5
9/20/11 CS 3343 Analysis of Algorithms 6
9/20/11 CS 3343 Analysis of Algorithms 7
3
3 4 2 4=b 5
a=2 5 3 1 5 6 7
1 7
9/20/11 CS 3343 Analysis of Algorithms 8
9/20/11 CS 3343 Analysis of Algorithms 9
9/20/11 CS 3343 Analysis of Algorithms 10
n n n n n n
2 22 21 1 12 11 2 22 21 1 12 11 2 22 21 1 12 11
nn n n nn n n nn n n
2 1 2 1 2 1
9/20/11 CS 3343 Analysis of Algorithms 11
9/20/11 CS 3343 Analysis of Algorithms 12
9/20/11 CS 3343 Analysis of Algorithms 13
9/20/11 CS 3343 Analysis of Algorithms 14
9/20/11 CS 3343 Analysis of Algorithms 15
9/20/11 CS 3343 Analysis of Algorithms 16
9/20/11 CS 3343 Analysis of Algorithms 17
9/20/11 CS 3343 Analysis of Algorithms 18
9/20/11 CS 3343 Analysis of Algorithms 19