Question: Given runtime of three different algorithms as below: T 1 ( N ) = N 2 l g N , T 2 ( N )

Given runtime of three different algorithms as below:
T1(N)=N2lgN,T2(N)=N3 and T3(N)=(1.2)N
Construct a table by varying N from N=10 to 200 and find out which algorithm is worst and which is best. Give proper reasoning for that.
2. Using the definition of big-O, big-omega () and big-theta () determine the best and worst algorithms in the following is given:
T1(N)=(N2),T2(N)=O(N2) and T3(N)=(N2)
Give proper justification to your answer.
3. Given a recursive function as below, you need to show all the steps (do not answer this question by running the computer program in a machine, but need to show the steps by hand calculation).
int mystery(int n)
{
if )(10
{
return n;
}
else
{
int a=n10
int b=n%10;
return mystery (a+b);
}
}
Determine the value of mystery(648)
4. Write a C++ program that would use a recursive function IsPalindrome(S, first, last)(please see the pseudocode for the algorithm) to check is a string S is Palindrome or not.
 Given runtime of three different algorithms as below: T1(N)=N2lgN,T2(N)=N3 and T3(N)=(1.2)N

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!