You are on page 1of 4

[Nov-22]

GITAM (Deemed to be University)


[19ECS234]
B.Tech. Degree Examination
Computer Science & Engineering (AIML/CS/DS)
V Semester
DESIGN AND ANALYSIS OF ALGORITHMS
(Effective from the admitted batch 2020–21)
Time: 3 Hours Max.Marks: 60
---------------------------------------------------------------------------------------------------
Instructions: All parts of the unit must be answered in one place only.
Figures in the right hand margin indicate marks allotted.
---------------------------------------------------------------------------------------------------
Section-A
1. Answer all Questions: (102=20)
a) Define Asymptotic notation and its representations.
b) What is the time complexity of strassen’s matrix multiplication?
c) Differentiate feasible and optimal solution with respect to Greedy
method.
d) Consider a problem instance of optimal storage on tapes with 5
programs (p1,p2,p3,p4,p5) of lengths (22,44,88,77,66). What is
best ordering of the programs to minimize the mean retrieval time?
e) What is the difference between dynamic programming and greedy
method?
f) Construct binary search tree for the following keys: 45, 15, 25, 35,
55, 5, 65 entered in that sequence and find post order traversal for
the same tree.
g) Write a recursive algorithm for the preorder traversal of a binary
tree T.
h) Define an Articulation point and identify the articulation
points(vertices) in the given graph

Page 1 of 4
i) Define Feasible Solution and Optimal Solution.
j) Convert the below matrix to reduced cost matrix form.

∞ 20 30 10 11
15 ∞ 16 4 2
3 5 ∞ 2 4
19 6 18 ∞ 3
16 4 7 16 ∞

Section-B
Answer the following: (58=40)
UNIT-I
2. Write an algorithm to find the maximum and minimum elements from
a given list of n elements using divide and conquer strategy.
OR
3. Sort {33,24,45,8,9,62,17} by using mergesort technique.
UNIT-II
4. Write an algorithm to find solution for the knapsack problem making
use of greedy approach. Consider n=7, size of knapsack m=15,
(w1, w2, w3, w4, w5, w6, w7) = (2,3,5,7,1,4,1), and the corresponding
profits are (10,5,15,7,6,18,3).
OR
5. Consider a job sequencing with deadlines problem instance with n=5,
Page 2 of 4
profits (p1,p2,p3,p4,p5) =(100,19,27,25,15) and deadlines
(d1,d2,d3,d4,d5)=(2,4,3,1,2). Find the maximum profit that can be
obtained by following deadlines.
UNIT-III
6. Explain travelling salesperson problem and find the optimal closed tour
path for the following graph with four vertices represented in cost
adjacency matrix form.

0 9 8 20
1 0 6 4
15 7 0 8
8 2 3 0

OR
7. Given the following digraph, find a matrix A such that, A(i,j) is the
length of a shortest path from i to j using dynamic programming. Also
present the formula used for solving this problem.

UNIT-IV
8. Write an algorithm to find all possibilities of coloring the vertices of a
graph of n vertices using at most m colors so that adjacent vertices are
not of the same color.
OR

Page 3 of 4
9. Write an algorithm/procedure to find the articulation points in a graph.
Find the articulation points in the below graph. Explain.

UNIT-V
10. Describe a suitable data structure to store a sparse polynomial and write
an algorithm to evaluate the below polynomial at 0, 1, and 2 using
Horner’s Method.
3x7-2x3+4x+2
OR
11. Consider the below cost matrix and find the minimum cost in travelling
sales person problem using branch and bound method.

∞ 19 28 9 10

14 ∞ 15 3 2

3 4 ∞ 2 3

20 6 17 ∞ 2

17 3 7 15 ∞

[8/V S/122]

Page 4 of 4

You might also like