0% found this document useful (0 votes)
162 views

Design and Analysis of Algorithms - Model Question Paper

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views

Design and Analysis of Algorithms - Model Question Paper

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

MODEL QUESTION PAPER

Code No: CS2501- SRGEC-R20


II B.Tech II Semester Regular Examinations
DESIGN AND ANALYSIS OF ALGORITHMS
(Computer Science and Engineering)
Time: 3 Hours Max. Marks: 70
Note: Answer all questions. All Questions carry Equal Marks
5 × 14 = 70M
Unit - I
BL
a) Determine the frequency counts for all the statements in the following
1. L3
algorithm. (7M)
For i:= 1to n do
For j:= 1 to i do
For k:= 1 to j do
x:= x+1 ;

b) ) Determine the time complexity for the following algorithm. (7M)


Algorithm Mult(a, b, c, m, n ,p)
{
For i:= 1to m do
For j:= 1 to p do
{
C[i,j]:= 0;
For k:= 1 to n do
C[i,j]:= C[i,j]+ a[ i,k]*b[k,j];
}
}

(OR)

2. a) Explain about the asymptotic notations with suitable examples. (10M) L2

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)

b) Solve the following recurrence relation using master method. (6M)

T (n) =2T (n/2) +n, T (0) =T (1)

(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)

b) Draw the binary decision tree for the following set.

“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)

b) Describe single source shortest path algorithm. (4M)

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)

a) Solve the following 0/1 knapsack problems using dynamic programming.


8. L3
P= (11,21,31,33), w=(2,11,22,15), m=40 and n=4. (7M)
b) ) Solve the all-pairs shortest path problem for the digraph with the weight
matrix:

(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

You might also like