Question: Q2. A. Find the time recurrence equation and the complexity (2 pts.) 1. int Fun1(int n) { if (n

Q2.

A. Find the time recurrence equation and the complexity (2 pts.)

1.

int Fun1(int n)

{

if (n <= 0)

return 1;

for (int i=0;i

constOperation;

return 1 + Fun1(n-1);

}

2.

int Fun2(int n)

{

if (n <= 0)

return 1;

for (int i=0;i

for(int j=0;j<=i;j++)

constOperation;

return 1 * Fun3(n/2);

}

B) Write D&C algorithm to search about an item K in a list. (2 Pts.)

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 Databases Questions!