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

3.42 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer of Questions Part 1Here a am including the written solut... View full answer

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