Design and Analysis of Algorithms - Model Question Paper
Design and Analysis of Algorithms - Model Question Paper
(OR)
b) ) what is meant by an algorithm? Explain about the criteria that can be followed
for an algorithm. (4M)
Unit - II
3. a) Show how MergeSort algorithm works on the data set L3
”100,300,150,450,250,350,200,400,500” and draw the merge tree. (8M)
(OR)
Page 1 of 3
a) Sort the record with the following index values using QuickSort.
4. L3
“20, 30, 10, 40, 5, 60, 90, 45, 35, 25, 15, 55”. (7M)
“3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 47”. And search for an
element x=30. (7M)
Unit - III
a) By applying greedy approach find the optimal solution to the knapsack
5. L3
instance n=5, M=10 (P1, P2, …. ,P 5) = (12, 32, 40, 30, 50) and (W1, W2, ….,
W5) = (4, 8, 2, 6, 1). (7M)
b) Find the optimal solution for the instance by applying JS algorithm.
n=7, (p1,p2,...p7) = (3,5,20,18,1,6,30) and (d1,d2,...d7) = (1,3,4,3,2,1,2) (7M)
(OR)
6. a) What is meant by minimum coast spanning tree? Write and explain Prim’s L2
algorithm with suitable example. (10M)
Unit - IV
7. a. Construct an optimal travelling sales person tour using Dynamic Programming L3
for the given data: (7M)
b) Find the minimum no of operations required for the following chain matrix
multiplication using dynamic programming. A(30,40) * B(40,5) * C(5,15) *
D(15,6).(7M)
(OR)
(7M)
Page 2 of 3
Unit - V
a) Draw the portion of state space tree generated by LCBB for the 0/1 Knapsack
9. L2
instance: n = 5, (p1,p2,…,p5) = (10,15,6,8,4), (w1,w2,..,w5) = (4,6,3,4,2) and
m=12. (8M)
b) Draw the states pace tree for m-coloring when m=3 and n=3. (6M)
(OR)
Apply the LCBB algorithm to solve the TSP for the following cost matrix and
10 L3
find reduced cost matrix and draw the portion of state space tree also. (14M)
.
∞ 11 10 9 6
8 ∞ 7 3 4
8 4 ∞ 4 8
11 10 5 ∞ 5
6 9 5 5 ∞
Page 3 of 3