You are on page 1of 2

Reg. No.

:
Name :

TERM END EXAMINATIONS (TEE) – December 2021- January 2022


Programme : B. Tech. [ BAI, BCE, MIM ] Semester : Fall 2021-22
Course Name : Design Analysis Of Algorithm Course Code : CSE3004
Faculty Name : Ab Rouf Khan Slot / Class No : A11+A12+A13 / 0292
Time : 1 ½ hour Max. Marks : 50

Answer ALL the Questions

Q. No. Question Description Marks

PART - A ( 30 Marks)
1 (a) i. Euler Tour problem, 𝑇 ∈ 𝑃-class of problems, whereas Hamiltonian cycle 10
problem, 𝐻 ∈ 𝑁𝑃-class of problems. Discuss how this scenario is possible?

ii. How could anyone reach to the conclusion that: “If one NP-complete problem
can be solved in polynomial time then all problems in NP can be solved in
polynomial time.”

OR
(b) Consider a scenario of multiplying a chain of 10
6 matrices - 𝑨𝟏 𝒕𝒐 𝑨𝟔 . The value of 𝒌 – which
gives the optimal parenthesization cost is
given in the table 𝒔[𝟏 … 𝟔], [𝟏 … 𝟔] on the left.
Construct the optimal solution to multiply
matrix chain 𝑨𝟏 𝒕𝒐 𝑨𝟔 using the optimal-
parenthesis algorithm.

2 (a) Given a Text String, 𝑻 as: 𝒂𝒃𝒂𝒃𝒄𝒂𝒃𝒂𝒂𝒃 and Pattern, 𝑷 as: 𝒄𝒂𝒃𝒂𝒂𝒃. Execute the 10
KMP string matching algorithm to find whether 𝑷 occurs in 𝑻?

OR
(b) Given a Text String, 𝑻 as: 𝟏𝟐𝟖𝟕𝟗𝟎𝟒𝟓𝟑𝟕𝟖𝟐 and Pattern, 𝑷 as: 𝟑𝟕, and the value of 10
𝒒 = 𝟏𝟏. Execute the Rabin-Karp string matching algorithm to find whether 𝑷 occurs
in 𝑻. Furthermore, find the total number of spurious hits that occur while matching the
pattern.

Page 1 of 2
3 (a) i. Why are the approximation algorithms are referred to as “Quick and Dirty?” 10

ii. Why are the geometric algorithms difficult to design and implement as
compared to the traditional algorithmic solutions?

OR
(b) Find the Convex Hull for the following set of points using: 10
i. Gift wrapping algorithm.
ii. Graham’s scan algorithm.

PART - B (20 Marks)


4 (a) What does maximum deadline, 𝒅 = 𝒏 imply in the activity selection problem? Support 5
your answer with a valid example.
(b) Find out the time complexity to compute the 𝒏𝒕𝒉 Fibonacci number using: 5
i. Top-down approach of problem solving.
ii. Bottom-up approach of problem solving.
5 Find the Approx_TSP_Tour cost for the 10
graph given adjacently using the double-
tree approximation alogorithm. The
steps of execution of the algorithm
should be properly formulated. In the last
step of the algorithm, if some nodes need
to be connected, take the corresponding
weights (distances) from the original
graph. However, if no path exists
between the nodes that are required to be
connected, assume the value of the
𝑤𝑒𝑖𝑔ℎ𝑡 = 10 for all the unavailable
edge weights.


Page 2 of 2

You might also like