Course Code : CAT 208 WYXZ/MS – 23 / 1744
Fourth Semester B. Tech. ( Computer Science and Engineering /
Artificial Intelligence and Machine Learning ) Examination
DESIGN AND ANALYSIS OF ALGORITHMS
Time : 3 Hours ] [ Max. Marks : 60
Instructions to Candidates :—
(1) Assume suitable data wherever necessary.
(2) All questions carry marks as indicated.
1. (a) Solve the recurrence relation using recurrence tree method :
T(n) = 2T(n/2) + %&
n + 5n 5(CO1)
(b) Solve the recurrence relation using substitution method :
T(n) = 4T (n/4) + n logn n > 1
= 1 n = 1 5(CO1)
2. (a) Discuss the drawbacks of traditional matrix multiplication over divide and
conquer matrix multiplication. Multiply the given matrices A and B using
Strassen's matrix multiplication algorithm :
A = ( ( 4
5
5
9
B = (2
1
10
6 ( 5(CO2)
(b) Write the algorithm to show how the merge function merges the two sorted
parts of the array A = [36 26 37 40 29 38 73 70 75 45].
5(CO2)
WYXZ/MS-23 / 1744 Contd.
3. (a) Find an optimal solution to the fractional knapsack problem for an instance
with number of items 7, Capacity of the sack W = 15, profit associated
with the items (p1, p2, . . . , p7) = (10, 5, 15, 7, 6, 18, 3) and weight associated
with each item (w1, w2, . . . , w7) = (2, 3, 5, 7, 1, 4, 1). 5(CO2)
(b) Compute the optimal solution for job sequencing with deadlines using
greedy method. N = 4, Profits (p1, p2, p3, p4) = (100, 10, 15, 27),
Deadlines (d1, d2, d3, d4) = (2, 1, 2, 1). Also discuss the time complexity
of given algorithm. 5(CO2)
4. (a) Find optimal solution for the given sequences. Also find the length of Longest
common subsequences :
X = <A B C B D A B>
Y = <B D C A B A> 3(CO3)
(b) Find the solution to the travelling salesman problem for the graph whose
adjacency matrix shown below :
Vertex 1 2 3 4
1 0 5 2 3
2 2 0 4 1
3 6 3 0 5
4 2 1 6 0 7(CO3)
5. (a) Implement sum of subset algorithm on the following data using backtracking
formulation :
W = {15, 5, 10, 20}
M = 30 5(CO3)
WYXZ/MS-23 / 1744 2 Contd.
(b) Explain the constraints used in backtracking solutions for Hamiltonian cycle
problem. Write the formulation to find the cycle and make a state space
tree with explanation for below graph.
5(CO3)
6. (a) Explain the methodology to prove that any problem is NP-Complete.
5(CO4)
(b) Devise an algorithm to find vertex cover with the help of suitable example.
5(CO4)
WYXZ/MS-23 / 1744 3 25