Question: Given these two methods: METHOD math 1 : public int math 1 ( int n ) { if ( n < = 1 ) {
Given these two methods:
METHOD math:
public int math int n
if n
return ;
if
else
return n math n;
else
math
METHOD math:
public int math int n
if n
return ;
if
else
return n math n math n;
else
math
a Set up a recurrence relation for the running time of the method math as a function of n Solve your recurrence relation to specify THETA bound of math
b Now set up a recurrence relation for the running time of the method math as a function of n Solve your recurrence relation to specify the BigO bound of math
HINT: When doing this, the call to math can be replaced by the equation that you found when solving the recurrence relation for math in part a
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
