Question: Attention: The parts ( a ) and ( b ) of this question are independent of each other!!! a ) Consider the recursive function below!

Attention: The parts (a) and (b) of this question are independent of each other!!!
a) Consider the recursive function below! Find, in terms of m, the recurrence (i.e., the
difference equation) that represents the execution time f(m) for recfunc.
void recfunc(int m){
if (m <9){
return;
}
recfunc(m/3);
for (int j =0; j < m; j++) printf(%d
, j);
for (int j =0; j <3; j++) recfunc(m/9);
for (int j =0; j < m; j++) printf(%d
, j);
recfunc(m/3);
for (int j =0; j < m; j++) printf(%d
, j);
}
f(m)=
b) Find the particular solution for the following recurrence with the given initial values!
Also give the asymptotic upper bound (O()). Show all your work!
t(n)=t(n-2)+n, t(0)=t(1)=0;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!