Data Structures and Algorithms Multiple Choice Questions - Set 14

131.       The sorting technique where array to be sorted is partitioned again and again in such a way that all elements less than or equal to partitioning element appear before it and those which are greater appear after it, is called ..............
(A) Merge sort
(B) Quick sort
(C) Selection sort
(D) None of these
Answer: B
132.       Which of the following asymptotic notation is the worst among all?
(A) Ο(n+9378)
(B) Ο(n3)
(C) nΟ(1)
(D) 2Ο(n)
Answer: D
133.       What value does function mystery return when called with a value of 4?
int mystery ( int number )
{
if ( number <= 1 )
return 1;
else
return number * mystery( number – 1 );
}
(A) 0
(B) 1
(C) 4
(D) 24
Answer: D
134.       Which of the following uses memorization?
(A) Greedy approach
(B) Divide and conquer approach
(C) Dynamic programming approach
(D) None of the above
Answer: C
135.       For an undirected graph G with n vertices and e edges, the sum of the degrees of each vertex is ........
(A) ne
(B) 2n
(C) 2e
(D) en
Answer: C

136.       The search technique for searching a sorted file that requires increased amount of space is ................
(A) Indexed sequential search
(B) Interpolation search
(C) Sequential search
(D) Tree search
Answer: A
Explanation:
The search technique for searching a sorted file that requires increased amount of space is indexed sequential search. Because in this search technique we need to maintain a separate index file which requires additional storage space.
137.       The postfix form of A ^ B * C - D + E/ F/ (G + H),
(A) AB^C*D-EF/GH+/+
(B) AB^CD-EP/GH+/+*
(C) ABCDEFGH+//+-*^
(D) AB^D +EFGH +//*+
Answer: A
138.       If locality is a concern, you can use ................ to traverse the graph.
(A) Breadth First Search
(B) Depth First Search
(C) Either BFS or DFS
(D) None of these
Answer: B
139.       The prefix of (A+B)*(C-D)/E*F is:
(A) /+-AB*CD
(B) /*+-ABCD*EF
(C) */*+AB-CDEF
(D) **AB+CD/EF
Answer: C
Explanation:
Prefix of (A+B) * (C - D) / E*F
(+AB) * (-CD) / E*F
*+AB-CD E*F
*/*+AB-CDEF
140.    Which of the following is a difference between vectors and arrays?
(A) Access to any element using the [] operator.
(B) Stored in contiguous blocks of memory.
(C) The ability to change size dynamically.
(D) Efficient direct access to any element.
Answer: C


Post a Comment

0 Comments