1. Algorithm A, B have running time 7n2+4n+5 and 3n2 respectively. Then in big theta approximation

 

A. Both have same complexity

2. Two main measure of efficiency of an algorithm

Answer :B. time and space

3. If p(x)=a1x+…+amxm (x>1) then p(x)=

Answer :A. O(xm)

4. If t1(n) = O(f(n)), t2(n)= O(g(n)). Then t1(n).t2(n)=_____

Answer :C. O(f(n)g(n))

5. In worse case analysis which one is true?

Answer :C. Merge sort is better than insertion sort

6. Insertion sort has

Answer : A. Worse case running time Θ(n2),averagecase running time Θ(n2).

7. Consider an array of elements A[5]= {5,4,3,2,1} , what are the steps of insertion sort

 

Answer :A. 4 5 3 2 1,3 4 5 2 1,2 3 4 5 1,1 2 3 4 5

 

8. Merge sort has worse case running time

Answer :A. Θ(nlogn)

9. Big Theta gives

Answer :C. Both Lower and Upper Bounds

10. When the array is already sorted in ascending order then running time using insertion sort is

Answer :A. Θ(n)

 

Categories: NPTEL solution

Leave a Reply

Your email address will not be published. Required fields are marked *