GATE 2024 algorithm Rank Booster Quiz 21
Attempt now to get your rank among 41 students!
Question 1
int Fun (int array [], int n)
{
int S=0;
if(n==0)
return 0;
S=Fun (array,n - 1)
if (array[n – 1]<=0)
S=S+100
return S;
}
What is the worst case time complexity of the above function?
Question 2
Question 3
{
if (n<=0)
return;
get (n - 1);
get (n - 3);
printf ("%d", n);
}
If T(n) = Number of functions calls for get(n) then which of the following is recurrence equation of T(n), for n > 0?
Question 4
Question 5
f(n) = 2log2n
g(n) = nlog2n
h(n) = n1/log2n
Which of the following statements about the asymptotic behavior of f(n), g(n) and h(n) is true?
Question 6
main()
{
for(i=1 ;i<=n; i= 20*i)
{
for(j=1 j<=n; j++)
{
if(n%j==0)
{
k=1
while(k<=n)
{
a=b+c;
k=k+1;
}
}
}
}
}
Assuming "n" to be a prime number , find the Time Complexity of the code?
Question 7
if n <= 3 then T(n) = n
else T(n) = T(n/3) + cn
Which one of the following represents the time complexity of the algorithm?
- 41 attempts
- 0 upvotes
- 0 comments
Tags :
GATE & PSU CSAlgorithms