logo

Crowdly

Browser

Add to Chrome

TT Module - VII

Looking for TT Module - VII test answers and solutions? Browse our comprehensive collection of verified answers for TT Module - VII at training.saveetha.in.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Consider the program

void function(int n) {

int i, j, count=0;

for (i=n/2; i <= n; i++)

for (j = 1; j <= n; j = j*2)

count++;}

The complexity of the program is

0%
0%
0%
0%
View this question

What is the time complexity of following code:

int a = 0, i = N;

while (i > 0) 

{

a += i;

i /= 2;

}

0%
100%
0%
0%
View this question

The complexity of Fibonacci series is

0%
0%
0%
0%
View this question

What is the time complexity of following code:

int a = 0;

for (i = 0; i < N; i++) 

{

for (j = N; j > i; j--) 

{

a = a + i + j;

}

}

0%
100%
0%
0%
View this question

What is the time complexity of the below function?

void fun(int n, int arr[]){    int i = 0, j = 0;    for(; i < n; ++i)        while(j < n && arr[i] < arr[j])            j++;}

0%
0%
100%
0%
View this question

What is the time complexity of following code:

int a = 0, i = N;

while (i > 0) 

{

a += i;

i /= 2;

}

0%
100%
0%
0%
View this question

What is the time complexity of following code:

int i, j, k = 0;

for (i = n / 2; i <= n; i++) 

{

for (j = 2; j <= n; j = j * 2) 

{

k = k + n / 2;

}

}

0%
0%
100%
0%
View this question

Suppose we have a ONo time algorithm that finds median of an unsorted array. Now consider a QuickSort implementation where we first find median using the above algorithm, then use median as pivot. What will be the worst case time complexity of this modified QuickSort.

100%
0%
0%
0%
View this question

What is the time, space complexity of following code:

int a = 0, b = 0;

for (i = 0; i < N; i++) 

{

a = a + rand();

}

for (j = 0; j < M; j++) 

{

b = b + rand();

}

0%
0%
0%
0%
View this question

Give the correct matching for the following pairs:

A. O(log n) 1. Selection sort

B. O(n) 2. Insertion sort

C. O(nlog n) 3. Binary search

D. O(n^2) 4. Merge sort

codes: 

A B C D

a. 3 1 2 4

b. 3 1 4 2

c. 1 3 4 2

d. 1 4 3 2

0%
0%
0%
0%
View this question

Want instant access to all verified answers on training.saveetha.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome