You are on page 1of 8

(01) Which of the following properties are necessary for an Algorithm?

(A) Definite ness (B) correct ness (C) Effectiveness (D) A and C

(02) which of the following technique is not using for solve a 0-1knapsack problem (A) Greedy (B) Dynamic programming (C) branch and bound (D) all of the above

(03)For the following program gives Big O analysis of the running time (in terms of n) For (i=0; i<n; i++) A*i+ = +; (A) O(n-1) (B) O(n) (C) O(n2) (D) O(log n)

(04) For the following program gives Big O analysis of the running time (in terms of n) For (i=0; i< n; i++) For (j=i; j< n; j++) For (k=j; k< n; k++) S++; (A) O(n-1) (B) O(n2) (C) O(n3) (D) O(log n)

(05) For the following program gives Big O analysis of the running time (in terms of n) For (i=0; i < n*n; i++)

A*i+ = i;

(A) O(n-1)

(B) O(n2)

(C) O(n3)

(D) O(log n)

(06) Given f(n) = log2n , g(n) = n which function is asymptotically faster (A) f(n) is faster than g(n) (B) g(n) is faster than f(n)

(C) Either f(n) or g(n) (D) Neither f(n) nor g(n) (07) Which of the following are true (a) 33n3 + 4n2 = p (n2) (b) n! = O(nn) (c) 10n2 + 9 = O(n2) (d) 6n3 /(log n +1) = O(n3) (A) a,b and c (B)a and c (C) a and b (D) all are true (08) n! = (A) O( 2n) (B) (2n) (C) A and B (D) O(n100)

None of them are correct (09) T (n) = 8T (n/2) + n2, T (1) = 1 then T (n) = (A) (n2) (B) (n3) (C) (n4) (D) (n)

(10) T (n) = 3T (n/4) + n then T (n) = (A) O (n2) (B) O (n3) (C) O (n) (D) O (n4)

(11) T (n) = 4T (n/2) + n then T (n) = (A) (n2) (B) (n3) (C) (n4) (D) (n)

(12) T (n) = 2T (n/2) + cn then T (n) = (A) O (log n) (B) O (n log n) (C) O (n2 log n) (D) O (n2) (13) T (n) = 2T (n/2) + n2 then T (n) = (A) (n2) (B) (n3) (C) (n4) (D) (n)

(14) T (n) = 2T (n/2) + n2 then T (n) =

(A) O (n3)

(B) O (n2)

(C) O (n)

(D) O (n4)

(15) T (n) = 9T (n/3) + n then T (n) = (A) (n4) (B) (n3) (C) (n2) (D) (n)

(16) T (n) = T (n/2) + 1 then T (n) = (A) O (log n) (B) O (2 log n) (C) O (n log n) (D) O (n2) (17) T (n) = T (n/2) + n2 then T (n) = (A) (n4) (B) (n3) (C) (n2) (D) (n)

(18) T (n) = 4T (n/2) + n2 then T (n) = (A) (n log n) (B) (n3 log n) (C) (n2 log n) (D) (n4 log n) (19) T (n) = 7T (n/2) + n2 then T (n) = (A) (n2.5) (B) (n2.807) (C) (n2.85) (D) (n2.75)

(20) T (n) = 2T (n/2) + n3 then T (n) = (A) (n4) (B) (n3) (C) (n2) (D) (n)

(21) T (n) = T (9n/10) + n then T (n) = (A) (n4) (B) (n3) (C) (n2) (D) (n)

(22) T (n) = 16T (n/4) + n2 then T (n) = (A) (n log n) (B) (n3 log n) (C) (n2 log n) (D) (n4 log n) (23) T (n) = 7T (n/3) + n2 then T (n) = (A) (n4) (B) (n3) (C) (n2) (D) (n)

(24) T (n) = 7T (n/2) + n2 then T (n) = (A) (nlog7) (B) (nlog5) (C) (nlog9) (D) (nlog3)

(25) T (n) = 2T (n/2) + n3 then T (n) =

(A) (n4)

(B) (n3)

(C) (n2)

(D) (n)

(26 T (n) = 2T (n/4) + n then T (n) ) = (A) (n log n) B) (n log n( ) (C) (n2 log n) (D) (n3 log n) (27 T (n) = T (n) +1 then T (n) = ) (A) (n log n) B) (n log n( ) (C) (log n) (D) (n2 log n) (28) T (n) = 100T (n/99) + log (n!) then T (n) = (A) (n log n) B) (n log n( ) (C) (n2 log n) (D) (n3 log n) (29) T (n) = T (n-1) + n4 then T (n) = (A) (n4) (B) (n3) (C) (n2) (D) (n)

(30) T (n) = 2T (n/2) + 3n2 and T (1) = 11 then T (n) = (A) O (n3) (B) O (n2) (C) O (n) (D) O (n4) (31) T (n) = 1 for n=1 = 2 * T (n - 1) for n >1 then T (n) = (A) 2 n (B) 2 n-1 (C) 2 n-2 (D) 2 n-3

(32) T (n) = 4T (n/2) + n2n then T (n) = (A) (n3n) (B) (n2) (C) (n2n) D) (nn( )

(33) T (n) = 2T (n/2) + (n/ log n) then T (n) = (A) (n log n) (B) (n log n log n) (C) (n2 log n log n) (D) (n2 log n) (34) T (n) = T (n/2) + T (n/4) + T (n/8) + n then T (n) = (A) (n4) (B) (n3) (C) (n2) (D) (n)

(35) Set defines as

(A) Distinct objects

(B) Similar elements (C) collection of elements

(D) objects

(36) A machine took 200 sec to sort 200 names, using bubble sort. In 800 sec, it can approximately sort (A) 400 names (B) 800 names (C) 750 names (D) 1800 names

(37) Linked lists are not suitable for (A) Insertion sort (B) Binary search (C) Radix sort (D) Polynomial manipulation (38) Which of the following is useful in implementing quick sort? (A) Stack (B) List (B) Set (D) Queue

(39) A machine needs a minimum of 100 sec to sort 1000 names by quick sort. The minimum time needed to sort 1000 names by quick sort. The minimum time needed to sort 100 names will be approximately? (A) 50.2 sec (B) 6.7 sec (C) 72.7 sec (D) 11.2 sec (40) Given 2 sorted lists of size m and n respectively. Number of comparisons needed in the worst case by the merge sort algorithm will be (A) mn (B) max(m,n) (C) min(m,n) (D) m+n-1

(41) The depth of a complete binary tree with n nodes is (A) log (n+1)-1 (B) log n (C) log (n-1)+ 1 (D) log n +1

(42) Average successful search time taken by binary search on a sorted array of items is (A) 2.6 (B) 2.7 (C) 2.8 (D) 2.9

(43) Average successful search time for sequential search on n items is (A) n/2 (B) (n-1)/2 (C) (n+1)/2 (D) n2

(44) The maximum number of comparisons needed to sort 7 items using radix sort is (assume each item is a 4 digit decimal number) (A) 280 (B) 40 (C) 47 (D) 38

(45) In Randomized Quick sort, the expected running time of any input is (A) O(n) (B) O(n2) (C) O(n log n ) (D) O(n3)

(46) If Total complexity after micro analysis is 5n3 + 10n2 + 100 n +400 logn+ 10, The Big Oh complexity is (A) O(n2) (B) O(n3) (C) O(nlogn) (D) O(n2logn)

(47) In Strassens Multiplication Algorithm the T(n) is A) 7T (n) + bn2 B) 7T (n/2) + bn2 C) 8T (n/2) + bn2 D) 7T (n/2) + bn

(48) T (n) = 4 T (n/2) + n then in Big Oh Notation it is A) O (n2) B) O(4) (C) O(n) D) O(log(n))

(49) In T(n) = a * T(n/b) + f(n) , a refers to (A) Size of sub problem (C) Size of the problem (B) No. of sub problems (D) Time to combine solutions

(50) 0-1 knapsack be solved using (A) dynamic programming (D) All A,B,C,E (B) Backtracking (E) Genetic Programming (C) Branch & Bound

(51) In depth first search algorithm the no. of recursive calls we have to make are (A) 2 (B) 1 (C) 6 (D) depends on the graph

(52) O (f(n)) minus O(f(n)) is equal to (A) Zero (B) A constant (C) f(n) (D) O(f(n))

(53) Quick sort is solved using (A) Divide and conquer (C) Dynamic Programming (54) For i = 1 to n-1 do (B) Greedy Programming (D) Branch and bound

2.1 For j = 1 to n-1-i do 2.2.1 If (a*j+1+ < a*j+) then swap a*j+ and a*j+1+ Given code is for (A) Bubble sort (B) Insertion sort (C) Quick Sort (D) Selection Sort

(55) Worst case complexity of quick sort is (A) O(n) (B) O(logn) (C) O(nlogn ) (D) O(n2)

(56) The sub problems in Divide and Conquer are considered to be A) Distinct (B) overlapping (C) large size (D) small size

(57) Which of the following name does not relate to stacks? (A) FIFO lists (B) LIFO list (C) Piles (D) Push-down lists (58 Which of the following data structure is linear type? (A) Strings (B) Lists (C) Queues D) All of above

(59) In a graph if e=(u, v) means (A) u is adjacent to v but v is not adjacent to u (B) e begins at u and ends at v (C) u is processor and v is successor (D) both b and c (60) An algorithm that calls itself directly or indirectly is known as (A) Sub algorithm (61) In a Heap tree (A) Values in a node is greater than every value in left sub tree and smaller than right sub tree (B) Values in a node is greater than every value in children of it (C) Both of above conditions applies (D) none of above conditions applies (62) (B) Recursion (C) Polish notation (D) Traversal algorithm

You might also like