You are on page 1of 6

1.

a.
b.
c.
d.

Binary search executes in ________ time.


O(n)
O(n2)
O(logn)
O(nlogn)

ANS: C
2. The recurrence relation for arises for computing the time complexity for
binary search is (where c is a constant)
a.
T(n)=T(n/2)+c
b.
T(n)=2T(n/2)+n2
c.
T(n)=2T(n/2)+c
d.
T(n)=T(n/2)+n
Ans: A
3. Which sorting algorithm have same time complexity in Best, Worst and
average cases
a. Quick sort
b. Insertion sort
c. Merge Sort
d. Selection sort
Ans: C
4. The recurrence relation of MERGESORT algorithm in worst case is:
a.
T(n)=2T(n/2)+nlogn
b.
T(n)=2T(n/2)+n2
c.
T(n)=2T(n/2)+c
d.
T(n)=2T(n/2)+n
Ans: D
5. The best case time complexity for merge sort is
a.
n
b.
nlogn
c.
logn
d.
n2
Ans: B
6. In case of unsuccessful search what is the worst case time complexity for
binary search is
a. O(1)
b. O(logn)
c. O(n)
d. O(nlogn)
Ans: B
a.
b.
c.
d.

7. The recurrence relation of QUICKSORT algorithm in worst case is


T(n)=2T(n/2)+nlogn
T(n)=2T(n-1)+n
T(n)=T(n-1)+n
T(n)=2T(n/2)+n

Ans: C
8. The best case time complexity for quick sort is
a.
n
b.
nlogn
c.
logn
d.
n2
Ans: B
9. The worst case time complexity for quick sort is
a.
n
b.
nlogn
c.
logn
d.
n2
Ans: d
10.Suppose the input array A[1n] is already in sorted order (increasing or
decreasing) then it is _______ case situation for QUICKSORT algorithm
a. Best
b. Worst
c. Average
d. Least
Ans: B
11.Which one of the following algorithm design techniques is used in
Strassens matrix multiplication algorithm?
a. Dynamic Programming
b. Greedy Method
c. Divide and Conquer
d. Backtracking
Ans: C
12.) Strassens algorithm is able to perform matrix multiplication in
time_______.
a. O(n3)
b. O(n2.71)
c. O(n2.81)
d. O(n2)
Ans : C
13.Strassens matrix multiplication algorithm (C = AB),if the matrices A and B
are not of type 2n 2n , the missing rows and columns are filled with
___________.
a. 0s
b. 1s
c. -1s
d. 2s
Ans : A
14.Strassens matrix multiplication requires ______ matrix multiplications and
______ matrix additions or subtractions.
a. 7 and 18
b. 8 and 4
c. 6 and 19

d. 5 and 22
Ans : A
15.The recurrence relation for strassens matrix multiplication is
a.
T(n)=7T(n/2)+n2
b.
T(n)=8T(n/2)+n2
c.
T(n)=5T(n/2)+n2
d.
T(n)=6T(n/2)+n2
Ans: A
16.What is the time complexity for multiplication of two matrices
a. O(n2)
b. O(n)
c. O(nlogn)
d. O(n3)
Ans: D
17.Strassens matrix multiplication algorithm (C = AB), the matrix C can be
computed using only 7 block multiplications and 18 block additions or
subtractions. How many additions and how many subtractions are there
out of 18?
a. 12 additions and 6 subtractions
b. 6 additions and 12 subtractions
c. 9 additions and 9 subtractions
d. 9 subtractions and 9 additions
Ans : A
18.Which of the following application is not belongs to divide and conquer
a. Binary Search
b. Finding the maxima and minima
c. Strassens Matrix multiplication
d. Travelling Sales Person Problem
Ans: D
19.Another name of quick sort is
a. Bubble sort
b. Exchange sort
c. Partition Exchange sort
d. Distribution sort
Ans : C

20.Which of the following is not the required condition for binary search
algorithm?
a. The list must be sorted
b. There should be the direct access to the middle element in any sub list
c. There must be mechanism to delete and/or insert elements in list.
d. We need to use divide and conquer to search an element
Ans : C
21.Which of the following sorting algorithm is belongs to divide and conquer
a. Bubble sort
b. Merge Sort
c. Insertion sort
d. Radix sort

a.
b.
c.
d.

Ans : B
22.The recurrence relation of finding the maxima and minima algorithm is
T(n)=2T(n/2)+nlogn
T(n)=2T(n-1)+n
T(n)=T(n-1)+n
T(n)=2T(n/2)+1

Ans : D
23.Time complexity for finding the maxima and minima is
a.
n
b.
nlogn
c.
logn
d.
n2
Ans: A
24.Which of the following algorithm is not a greedy algorithm?
a. Prims Algorithm
b. Kruskals Algorithm
c. Dijkastras Algorithm
d. Bellman Ford Algorithm
Ans: D
------------------------------------------------25.Which of the following is an application of greedy method
a. Job sequencing with dead lines
b. Graph coloring
c. Merge sort
d. Travelling sales person problem
Ans: A
26.The running time of KRUSKALs algorithm, where |E| is the number of
edges and |V| is the number of nodes in a graph:
a. O(|E|)
b. O(|E|log|E|)
c. O(|E|log|V|)
d. O(|V|log|V|)
Ans :C
27.The running time of PRIMs algorithm, where |E| is the number of edges
and |V| is the number of nodes in a graph:
a. O(|E|2)
b. O(|V|2)
c. O(|E|log|V|)
d. O(|V|log|V|)
Ans: B
28.The optimal solution to the knapsack instance n=3, M=20, (P1 ,P2 ,P3 )=
(25,24,15) and ( W1,W2 ,23 )= (18,15,10) is
a. 24
b. 31.5
c. 41.5
d. 27
Ans: B

29.The optimal Knapsack instance (X1,X2,X3)=(?,?,?) for the given n=3,


M=20, (P1 ,P2 ,P3 )= (25,24,15) and ( W1,W2 ,23 )= (18,15,10) is
a. (1,1,0)
b. (0,1,1/2)
c. (0,2/3,1)
d. (1,2/15,0)
Ans: B
30.If a complete graph contains n vertices ,the possible number of spanning
trees are
a.
n
b.
n2
c.
n-1
d.
nn-2
Ans:D
31.If a complete graph contains 4 vertices ,the possible number of spanning
trees are
a. 4
b. 8
c. 16
d. 3
Ans :C
32.If a complete graph contains 5 vertices ,the possible number of spanning
trees are
a. 5
b. 25
c. 125
d. 4
Ans : C
33.Let (i, j,C) , where i and j indicates vertices of a graph & C denotes cost
between edges. Consider the following edges & cost in order of increasing
length: (b,e,3),(a,c,4),(e,f,4), (b,c,5),(f,g,5),(a,b,6), (c,d,,6),(e,f,6), (b,d,7),
(d,e,7),(d,f,7),(c,f,7). Which of the following is NOT the sequence of edges
added to the minimum spanning tree using Kruskals algorithm?
a. (b,e),(e, f ),(a,c),(b,c),( f , g),(c,d)
b. (b,e),(e, f ),(a,c),( f , g),(b,c)(c,d)
c. (b,e),(a,c),(e, f ),(b,c),( f , g),(c,d)
d. (b,e),(e, f ),(b,c),(a,c),( f , g),(c,d)
Ans: D
34. Dijkstras algorithm running time, where n is the number of nodes in a
graph is:
a. O(n2)
b. O(n)
c. O(n3)
d. O(nlogn)
Ans :A
35.Which of the following algorithm is used for finding the shortest paths for
visiting all vertices from single source
a. Prims Algorithm
b. Kruskals Algorithm
c. Dijkastras Algorithm
d. Warshalls Algorithm
Ans :C

Ans: C
36. Which of the following statements is true about Kruskal's algorithm.
a. It is an inefficient algorithm, and it never gives the minimum spanning tree.
b. It is an efficient algorithm, and it always gives the minimum spanning tree.
c. It is an efficient algorithm, but it doesn't always give the minimum spanning tree.
d. It is an inefficient algorithm, but it always gives the minimum spanning tree.
Ans : B
37.
. To assign n programs to m tapes we require a computing time of -----a. O(n)
b. O(nlogn)
c. O(m)
d. O(n*m)
Ans: A

You might also like