You are on page 1of 2

Reg. No.

:
Name :

TERM END EXAMINATIONS (TEE) – February-March 2023


Programme : B.Tech. Semester : Winter 2022-23
Course Title / Design Analysis of Algorithm /
: Slot : A11+A12+A13
Course Code CSE3004
Time : 1½ hours Max. Marks : 50
Answer ALL the Questions
Q. No. Question Description Marks
PART - A ( 30 Marks)
1 (a) Problems P1 and P2 are unknown decision problems (i.e., don't have
information about P or NP). If any of one NP-Complete problem (let say SAT)
is the polynomial-time reducible to P1, and P2 is reducible to a one problem
10
present in NP, and that problem is again reducible to NP-Complete problem in
polynomial time, then P1 and P2 will become which class? Justify your answer
with a proper explanation? How Polynomial time Reduction (reducibility)
useful to prove P=NP or P! = NP?
OR
(b) Let “XZXYY” and “ZXZYXYZ” be two strings. Derive the longest common
subsequence (LCS) length from given strings using the dynamic programming
tabulation method and list out all possible LCS strings which have a max 10
length?.

2 Give an example to illustrate spurious hits in the Rabin-Karp string matching


(a) method. How many false positives does the Rabin-Karp matcher find when 10
searching for the pattern P = 31415 in the text T = 2359023141526739921
working modulo q = 13?
OR
(b) Determine the longest prefix that is also a suffix from a given string S. Prefixes
and suffixes shouldn't cross each other. Describe the algorithm and its time 10
complexity.
S=”aabcdaabc”.

3 (a) Determine the Convex Hull Problem. Using your own example, discuss the
brute force method for solving convex hull. Calculate time complexity. 10

OR
(b) Why are approximation algorithms good?
Apply an approximate algorithm for TSP that returns a tour with a cost that is 10
never twice as high as the cost of an ideal tour for the given example

Page 1 of
2
PART - B (20 Marks)
4 Distinguish procedures for 0/1 Knapsack and fractional knapsack problem, Identify
the algorithm methodologies used for these Knapsack problems, Solve the following
Knapsack problem using Greedy method approach. Here Knapsack capacity W=10.
10
Item Weight Value
A 4 40
B 7 42
C 5 25
D 3 12

5 Determine the largest number of triangles (including triangles with no area) that can
be made by connecting the intersection points of the given 'n' line segments, each of
which is either horizontal or vertical for the below line segments.

10
|
---|-------|--
| | -----
| --|--|- |
| | |



Page 2 of
2

You might also like