# Data Structures and Algorithms Multiple Choice Questions - Set 16

151.       If h is any hashing function and is used to hash n keys in to a table of size m, where n<=m, the expected number of collisions involving a particular key x is :
(A) less than 1
(B) less than n
(C) less than m
(D) less than n/2
152.       The worst case of quick sort has order ..............
(A) O(n2)
(B) O(n)
(C) O (n log2 n)
(D) O (log2 n)
153.       Let A be an adjacency matrix of a graph G. The ijth entry in the matrix AK , gives
(A) The number of paths of length K from vertex Vi to vertex Vj.
(B) Shortest path of K edges from vertex Vi to vertex Vj.
(C) Length of a Eulerian path from vertex Vi to vertex Vj.
(D) Length of a Hamiltonian cycle from vertex Vi to vertex Vj.
154.       The OS of a computer may periodically collect all the free memory space to form contiguous block of free space. This is called:
(A) Concatenation
(B) Garbage collection
(C) Collision
(D) Dynamic Memory Allocation
155.       What is the following code segment doing?
void fn( ){
char c;
cin.get(c);
if (c != ‘\n’) {
fn( );
cout.put(c);
}
}
(A) The string entered is printed as it is.
(B) The string entered is printed in reverse order.
(C) It will go in an infinite loop.
(D) It will print an empty line.

156.       You have to sort a list L consisting of a sorted list followed by a few “random” elements.
Which of the following sorting methods would be especially suitable for such a task?
(A) Bubble sort
(B) Selection sort
(C) Quick sort
(D) Insertion sort
157.       B Trees are generally
(A) very deep and narrow
(B) very wide and shallow
(C) very deep and very wide
(D) cannot say
158.       Linked list search complexity is ...............
(A) Ο(1)
(B) Ο(n)
(C) Ο(log n)
(D) Ο(log log n)
159.       If the data collection is in sorted form and equally distributed then the run time complexity of interpolation search is ............
(A) Ο(n)
(B) Ο(1)
(C) Ο(log n)
(D) Ο(log (log n))