On DAA
On DAA
CA2 EVALUATION
REPORT WRITING
MASTER THEOREM METHOD
UNDER THE GUIDANCE OF
PROF.HASNAHANA KHATUN
NAME: BITHIKA SAHA
UNIVERSITY ROLL NO:34230823009
REGISTRATION NO:233420110069
DEPARTMENT: CSE(AI&ML)
PAPER NAME: DESIGN AND ANALYSIS
OF ALGORITHMS
PAPER CODE: PCC-CS404
ABSTRACT:
The master theorem is a fundamental tool used to
analyze the time complexity of divide-and-conquer
algorithms by solving recurrences of the form T(n)=a
T(n/b) +f(n). It provides an efficient way to determine the
asymptotic behavior of such recurrences by comparing
the function f(n) with nlogba. The theorem outlines three
cases based on this comparison: when f(n)grows slower,
at the same rate, or faster than nlogba. Depending on the
case, the time complexity is derived, making the Master
Theorem a widely used technique in algorithm analysis.
However, it is limited to recurrences that fit its specific
form and does not handle all types of divide-and-conquer
recurrences.
INTRODUCTION:
The Master Theorem is a powerful tool used to analyze
the time complexity of recursive algorithms. It provides a
straightforward method for solving recurrences that arise
from divide-and-conquer algorithms. A divide-and-
conquer algorithm divides a problem into subproblems,
solves the subproblems recursively, and combines their
results. The Master Theorem gives us a direct way to
determine the asymptotic behavior (i.e., Big-O) of the
time complexity of such algorithms.
DICUSSION OF BODY:
➢ Recurrence Relations and Their Role:
Divide-and-conquer algorithms often result in
recursive relations that describe the time complexity
of breaking down a problem. The Master Theorem
applies to recurrences of the form
T(n)=a T(n/b) +f(n).
Where:
f(n)=θ (nk (log n)) p
T(n)=a+(n/b) + θ (nk (log n)) p
a>=1, a=no. of problems
b>1, n/b=size of each subproblem.
k=power of n
p=power of log n
➢ The Three Cases of the Master Theorem:
The Master Theorem identifies the asymptotic
behavior of recurrences based on the comparison
between f(n) and nlogba ,where nlogba is the work done
in the recursive calls. The following are the three
cases described in the theorem:
CONCLUSION:
The Master Theorem is a powerful and efficient tool for
analyzing the time complexity of divide-and-conquer
algorithms. It provides a quick way to solve recurrences
of the form T(n)=a T(n/b) +f(n). offering clear insights into
the asymptotic behavior of such algorithms. However, its
applicability is limited to specific types of recurrences,
and it cannot handle more complex or irregular
recursions. Despite its limitations, it remains an essential
technique for many common algorithmic analyses.
REFERENCES:
[1] https://www.geeksforgeeks.org/advanced-master-
theorem-for-divide-and-conquer-recurrences/ [An online
resource for the information about Master Theorem
Method]
[2]. https://www.geeksforgeeks.org/advanced-master-
theorem-for-divide-and-conquer-recurrences/ [An online
resource for the examples of Master Theorem Method].