Professional Documents
Culture Documents
MCQ Test Questions On Data Structures and Algorithms WWW Psexam Com PDF
MCQ Test Questions On Data Structures and Algorithms WWW Psexam Com PDF
PSC01
FM: 50
PM: 30
Time: 1 hrs
Attempt All of the following questions. Each question carry equal mark
Total Questions 50
shkhanal
Your Name
Q.1)
6 files X1, X2, X3, X4, X5, X6 have 150, 250, 55, 85, 125, 175 number of records respectively. The order of storage ot optimize
access time is
A.
B.
C.
D.
Q.2)
B.
C.
D.
L1,L2
Max(L1,L2)
Min(L1,L2)
L1+L2-1
Q.4)
Consider two sorted lists of size L1, L2. Number of comparisions needed in worst case my merge sort algorithm will be
A.
Q.3)
n/2
(n-1)/2
(n+1)/2
log (n) + 1
B.
C.
D.
B.
C.
D.
B.
C.
D.
B.
C.
D.
log (n)
log (n -1)n -1
log (n) + 1
S [Top-n]
S [Top+n]
S [Top-n-1]
None of the above
Bubble sort
Quick sort
Merge sort
Heap sort
Log n
n
n2
nn
Q.10)
log (n +1) - 1
Time complexity of an algorithm T(n), where n is the input size is given by T(n) = T (n-1) + 1/n, if n>1 otherwise T(n) = 1. The order
of algorithm is
A.
Q.9)
-, x, y, +, *, z, w
Q.8)
x, y, z, w, -, *, +
In a stack the command to access nth element from the top of the stack S will be
A.
Q.7)
x, -, y, +, z, *, w
Q.6)
+, -, *, x, y, z, w
FILO
FIFO
LIFO
Both a and c above
A.
B.
C.
D.
Q.11)
B.
C.
D.
B.
C.
D.
bubble sort
selection sort
insertion sort
merge sort
2.15
3.01
2.3
1.78
A queue has configuration a,b,c,d. To get configuration d,c,b,a. One needs a minimum of
A.
B.
C.
D.
Q.14)
A text is made up of five characters, T1, T2, T3, T4, T5. The probability of occurance of each character is .12, .4, .15, .88 and .25,
respectively. The optimal coding technique will have average length of
A.
Q.13)
Q.12)
A hash tabale with 10 buckets with one slot per bucket is depicted in following diagram. Symbols S1 to S7 are initially entered
using a hashing function with linear probing. Maximum number of comparisions needed in searching an item that is not present is
A.
B.
C.
D.
Q.15)
B.
C.
D.
B.
C.
D.
B.
C.
D.
3
Junk value
Run time error
Address of the third element
Max(f(n),g(n))
Min(f(n),g(n))
f(n)+g(n)
f(n)*g(n)
constant
linear
logarithmic
exponential
A binary tree in which every non-leaf node has non-empty left and right sub trees is called a strictly binary tree. Such a tree with 10
leaves
A.
B.
C.
D.
Q.19)
The order of an algorithm that finds whether a given boolean function of 'n' variable produces a '1' is
A.
Q.18)
An algorithm consists of two modules X1, X2. Their order is f(n) and g(n), respectively. The order of algorithm is
A.
Q.17)
Q.16)
Has 19 nodes
Has 16 nodes
Has 15 nodes
None of the above
Average successful search time taken by binary search on sorted array of 10 items is
2.6
2.7
2.8
2.9
If the address of (I,J)th entry, in dope vector representation, where it stores the position of first and last non-zero entries of each
row is given by C, assume l(n) and f(n) represent the last and first non-zero entries in row x
i.
ii.
iii.
iv.
A.
B.
C.
D.
Q.21)
If the out degree of every node is exactly equal to M or 0 and the num ber of nodes at level K is Mk-1 [con
sider root at level 1], then tree is called as
(i) Full m-ary try
(ii) Com plete m-ary tree
(iii)Positional m-ary tree
A.
B.
C.
D.
Q.22)
Only (i)
Only (ii)
Both (i) and (ii)
Both (ii) and (III)
Running time T(n), where 'n' is input size of recursive algorithm is given as follows:
T(n) = c + T(n-1), if n>1,
T(n) = d if n<1. The order of algorithm is
A.
B.
C.
n2
n
n3
Q.24)
In evaluating arithmatic expression 2*3-(4+5) using postfix stack form. Which of the following stack configuration is not possible
A.
-----------|4|6|
------------
B.
-----------|5|4|6|
------------
C.
-----------|9|6|
------------
D.
-----------|9|3|2|
------------
Number of swapping, operations need to sort numbers 8, 22, 7, 9, 31, 19, 5, 13 in ascending order using bubble sort
A.
B.
C.
D.
Q.25)
B.
C.
D.
B.
C.
D.
13
14
16
12
6
10
In which of the following cases linked list implementaion of sparse matrices consumes same memory as a normal array
A.
B.
C.
D.
Q.28)
12
Q.27)
11
Q.26)
nn
A.
B.
C.
D.
Q.30)
B.
C.
D.
B.
C.
D.
B.
C.
D.
B.
C.
D.
n2
nn
n3
n
O(n logn)
O(2n)
O(n2)
None of above
Conceptually easier
Completely dynamic
Efficient in accessing an entry
Efficient if the sparse matr4ix is a band matrix
A1
A2
A3
A4
Q.35)
2,1,2,2,2
Four altorithm A1, A2, A3, A4 solves a problem with order log(n), log log(n), nlog(n), n. Which is best algorithm
A.
Q.34)
2,1,2,2,1
The advantage of sparse matrix linked list representationn over dope vector method is, that the former is
A.
Q.33)
2,2,1,1,2
Q.32)
2,2,1,2,2
Running time of an algorithm T(n), where n is input size is given by T(n) = 8 T(n/2) + qn, if n>1 T(n) = p, if, n=1 where p and q are
constants. The order of algorithm is
A.
Q.31)
None of these
Following sequence of operation is performed on a stack. Push(1), Push(2), Pop, Push(1), Push(2), Pop, Pop, Pop, Push(2), Pop.
The sequences of popped out values are
B.
C.
D.
B.
C.
D.
B.
C.
D.
B.
C.
D.
5
6
Dijkastra's algorithm
Floyd's algorithm
Prim's algorithm
Worshal's algorithm
150
140
55
None of the above
In a balance binary tree the height of two sub trees of every node can not differ by more than
A.
B.
C.
D.
Q.41)
Q.40)
Q.39)
None of above
Q.38)
Hash function f is defined as f(key) = key mod 7. If linear probing is used to insert the key 37, 38, 72, 48, 98, 11, 56 into a table
indexed from 0 to 6, 11 will be stored at the location
A.
Q.37)
2
1
0
3
Heap sort
Quick sort
Insertion sort
Selection sort
In array representation of binary tree teh right child of root will be at location of
A.
B.
C.
D.
2
5
3
0
Q.43)
The information about an array used in a program will be stored in
A.
B.
C.
D.
Q.44)
B.
C.
D.
B.
C.
D.
B.
C.
D.
0
5
10
15
Stable
Consistent
External
Linear
xxx
yyy
zzz
Can not be determined
Q.48)
Activation table
If yyy, xxx and zzz are the elements of a lexically ordered binary tree, then in preorder traversal which node will be traverse first
A.
Q.47)
Register vector
A sorting technique which guarrantees that records with same primary key occurs in the sorted list as in the original unsorted list
is said to be
A.
Q.46)
Dope vector
The result of evaluating prefix expression */b+0dacd, where a=3, b=6, c=1, d=5 is
A.
Q.45)
Symbol table
n
n2
n log n
log n
If running time of an algorithm is given by T(n) = T(n-1) + T(n-2) + T(n-3), if n>3 otherwise T(n)=n, what should be relation between
T(1), T(2), T(3) where algorithm order become constant
A.
B.
T(1)=T(2)=T(3)
T(1) + T(2) = 2T2
If the following tree is used for sorting, then a new number 10 should be placed at
A.
B.
C.
D.
Q.50)
The average number of comparisions performed by merge sort alrotithm in merging two sorted list of length 2 is
A.
B.
C.
D.
8/3
8/5
11/7
11/6