20-04-2013, 04:13 PM
DATA STRUCTURES TYPICAL QUESTIONS & ANSWERS
DATA STRUCTURES.pdf (Size: 861.5 KB / Downloads: 308)
Each Question carries 2 marks.
Q.1 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.
© less than m. (D) less than n/2.
Ans:A
Q.2 Let A be an adjacency matrix of a graph G. The th ij entry in the matrix K A , 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.
© Length of a Eulerian path from vertex Vi to vertex Vj.
(D) Length of a Hamiltonian cycle from vertex Vi to vertex Vj.
Ans:B
Q.3 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
© Collision (D) Dynamic Memory Allocation
Ans:B
Q.4 What is the following code segment doing?
void fn( ){
char c;
cin.get©;
if (c != ‘\n’) {
fn( );
cout.put©;
(A) The string entered is printed as it is.
(B) The string entered is printed in reverse order.
© It will go in an infinite loop.
(D) It will print an empty line.
Ans:B
Q.5 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
© Quick sort (D) Insertion sort
Ans
Q.6 B Trees are generally
(A) very deep and narrow (B) very wide and shallow
© very deep and very wide (D) cannot say
Ans
Q.7 A technique for direct search is
(A) Binary Search (B) Linear Search
© Tree Search (D) Hashing
Ans
Q.8 If a node having two children is deleted from a binary tree, it is replaced by its
(A) Inorder predecessor (B) Inorder successor
© Preorder predecessor (D) None of the above
Ans:B
Q.9 The searching technique that takes O (1) time to find a data is
(A) Linear Search (B) Binary Search
© Hashing (D) Tree Search
Ans:C
Q.10 A mathematical-model with a collection of operations defined on that model is called
(A) Data Structure (B) Abstract Data Type
© Primitive Data Type (D) Algorithm
Ans:B
Q.11 The number of interchanges required to sort 5, 1, 6, 2 4 in ascending order using Bubble Sort
is
(A) 6 (B) 5
© 7 (D) 8
Ans:B