SlideShare a Scribd company logo
Divide and Conquer
Analysis of Algorithms
Master Theorem
The solution to the equation
T(n) = aT(n/b) + θ(nk
), where a >= 1 and b >1 is
Ө(nlog
b
a
) if a > bk
T(n) = Ө(nk
logn) if a = bk
Ө(nk
) if a < bk
Example
Solve the following recurrence using Master Theorem
T(n) = 8T(n/2) + O(n2
)
a = 8, b = 2, k = 2
⇒a > bk
, 8 > 22
)()()( 38lg2
nOnOnT ==⇒
Matrix Multiplication
procedure stmul(n,A,B,C)
if n>=1
partition A into A11,A12,A21,A22
partition B into B11,B12,B21,B22
c=AxB
stmul(n/2,A11,B11,m1)
stmul(n/2,A12,B21,m2)
stmul(n/2,A11,B12,m3)
stmul(n/2,A12,B22,m4)
stmul(n/2,A21,B11,m5)
stmul(n/2,A22,B21,m6)
stmul(n/2,A21,B12,m7)
stmul(n/2,A22,B22,m8)
c11=m1+m2, c12=m5+m6
c21=m3+m4, c22=m7+m8
Function Calls
m1=A11B11, m2=A12B21, m3=A11B12
m4=A12B22, m5=A21B11, m6=A22B21
m7=A21B12, m8=A22B22
Analysis, Multiplications
T(n)=8T(n/2)
T(n/2)=8T(n/4)
T(n/4)=8T(n/8)
By backward substitution
T(n)=82
T(n/4)
=83
T(n/8)
=8i
T(n/2i
)
=8 i
T(n/2i
)
let 2i
=n
T(n)=8lgn
=nlg8
=n^3
Additions
 
t(n)=8t(n/2)+4(n/2)2
a=8, b=2, k=2
by applying master theorem
T(n)= n log
b
a
= nlg8
=n3
єӨ(n3
)
Strassen’s Multiplication
C11 C12 A11 A12 B11 B12
= *
C21 C22 A21 A22 B21 B22
m1=A11(B12-B22)
m2=(A11+A12)B22
m3=(A21+A22)B11
m4=A22(B21-B11)
m5=(A11+A22)(B11+B22)
m6=(A12-A22)(B21+B22)
m7=(A11-A21)(B11+B12)
C11=m5+m4-m2+m6, C21=m3+m4
C12=m1+m2 C22=m1+m5-m3-m7
Complexity(multiplication, addition&
Subtraction)
t(n)=7t(n/2)+kn 2
a=7,b=2,d=2
byapplyingmastertheorem
T(n)= n log
b
a
= nlg7
=n2.8
єӨ(n2.8
)
Complexity(multiplication, addition&
Subtraction)
t(n)=7t(n/2)+kn 2
a=7,b=2,d=2
byapplyingmastertheorem
T(n)= n log
b
a
= nlg7
=n2.8
єӨ(n2.8
)

More Related Content

PPT
Matrix Multiplication(An example of concurrent programming)
PDF
A Note on TopicRNN
PDF
IB SL Trigonometric functions
PDF
A Note on Latent LSTM Allocation
PDF
Fundamentals of Transport Phenomena ChE 715
PDF
Bayesian Inference and Uncertainty Quantification for Inverse Problems
PPT
1.5 7th
Matrix Multiplication(An example of concurrent programming)
A Note on TopicRNN
IB SL Trigonometric functions
A Note on Latent LSTM Allocation
Fundamentals of Transport Phenomena ChE 715
Bayesian Inference and Uncertainty Quantification for Inverse Problems
1.5 7th

What's hot (19)

PDF
Simpli fied Solutions of the CLP and CCP Limiting Cases of the Problem of Apo...
PPT
how to calclute time complexity of algortihm
PPT
Modeling quadratic fxns
PDF
QMC: Operator Splitting Workshop, Forward-Backward Splitting Algorithm withou...
PDF
R09 optimal control theory
PDF
A block-step version of KS regularization
PPT
Mba admission in india
PPT
asymptotic notations i
PPT
Hprec7.1
PDF
Asymptotic notation
PDF
Quadrature
PDF
R package 'bayesImageS': a case study in Bayesian computation using Rcpp and ...
PPT
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
PPTX
Golden Section method
TXT
Demodulate bpsk up
PDF
Discretization
PDF
Goldberg-Coxeter construction for 3- or 4-valent plane maps
PPTX
Karatsuba algorithm for fast mltiplication
Simpli fied Solutions of the CLP and CCP Limiting Cases of the Problem of Apo...
how to calclute time complexity of algortihm
Modeling quadratic fxns
QMC: Operator Splitting Workshop, Forward-Backward Splitting Algorithm withou...
R09 optimal control theory
A block-step version of KS regularization
Mba admission in india
asymptotic notations i
Hprec7.1
Asymptotic notation
Quadrature
R package 'bayesImageS': a case study in Bayesian computation using Rcpp and ...
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
Golden Section method
Demodulate bpsk up
Discretization
Goldberg-Coxeter construction for 3- or 4-valent plane maps
Karatsuba algorithm for fast mltiplication
Ad

Similar to 07 dc3 (20)

PPTX
Divide and conquer strategy
PPTX
AOA.pptx
PDF
Master’s theorem Derivative Analysis
PPTX
Recurrence relationclass 5
PPTX
Divide and Conquer_Binary_Search_Merge_Sort.pptx
DOC
pradeepbishtLecture13 div conq
PPT
Divide and Conquer
PPT
Time complexity
PPT
Lecture11_12COMPILER DESIGN_unit 2COMPILER DESIGN_unit 2.ppt
PPT
3-Chapter Three - Divide and Conquer.ppt
PPTX
Improvised Master's Theorem
PPTX
Analysing Recursive Algorithms(Recurrence Equation and Master Theorem).pptx
PPT
3. Recursion and Recurrences.ppt detail about recursive learning
PPT
recurrence relation is explained in this
PDF
02 Notes Divide and Conquer
PDF
Master theorem
PDF
Lecture no 9(extended master method)
PPTX
UNIT I- Session 8.pptxgdsgdgssdggdsdsgdd
PPTX
Master's Theorm.pptx
PPT
DivideAndConquer.pptDivideAndConquer.ppt
Divide and conquer strategy
AOA.pptx
Master’s theorem Derivative Analysis
Recurrence relationclass 5
Divide and Conquer_Binary_Search_Merge_Sort.pptx
pradeepbishtLecture13 div conq
Divide and Conquer
Time complexity
Lecture11_12COMPILER DESIGN_unit 2COMPILER DESIGN_unit 2.ppt
3-Chapter Three - Divide and Conquer.ppt
Improvised Master's Theorem
Analysing Recursive Algorithms(Recurrence Equation and Master Theorem).pptx
3. Recursion and Recurrences.ppt detail about recursive learning
recurrence relation is explained in this
02 Notes Divide and Conquer
Master theorem
Lecture no 9(extended master method)
UNIT I- Session 8.pptxgdsgdgssdggdsdsgdd
Master's Theorm.pptx
DivideAndConquer.pptDivideAndConquer.ppt
Ad

More from Hira Gul (12)

PPTX
Final iwvc
PPTX
Oerating system project
PPTX
project Judaism iwvc presentation
PPT
09d transform & conquer spring2015
PPTX
08 decrease and conquer spring 15
PPTX
06 dc2
PPT
05 dc1
PPT
04 brute force
PPT
03 mathematical anaylsis
PPT
03 dc
PPT
02 order of growth
PPT
01 intro to algorithm--updated 2015
Final iwvc
Oerating system project
project Judaism iwvc presentation
09d transform & conquer spring2015
08 decrease and conquer spring 15
06 dc2
05 dc1
04 brute force
03 mathematical anaylsis
03 dc
02 order of growth
01 intro to algorithm--updated 2015

Recently uploaded (20)

PDF
STL Containers in C++ : Sequence Container : Vector
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
Salesforce Agentforce AI Implementation.pdf
PPTX
GSA Content Generator Crack (2025 Latest)
PPTX
Custom Software Development Services.pptx.pptx
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PPTX
Trending Python Topics for Data Visualization in 2025
PPTX
"Secure File Sharing Solutions on AWS".pptx
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PPTX
Patient Appointment Booking in Odoo with online payment
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
Digital Systems & Binary Numbers (comprehensive )
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
STL Containers in C++ : Sequence Container : Vector
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
Salesforce Agentforce AI Implementation.pdf
GSA Content Generator Crack (2025 Latest)
Custom Software Development Services.pptx.pptx
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
Trending Python Topics for Data Visualization in 2025
"Secure File Sharing Solutions on AWS".pptx
Oracle Fusion HCM Cloud Demo for Beginners
Wondershare Recoverit Full Crack New Version (Latest 2025)
Patient Appointment Booking in Odoo with online payment
Monitoring Stack: Grafana, Loki & Promtail
Weekly report ppt - harsh dattuprasad patel.pptx
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Complete Guide to Website Development in Malaysia for SMEs
Digital Systems & Binary Numbers (comprehensive )
Advanced SystemCare Ultimate Crack + Portable (2025)

07 dc3