0% found this document useful (0 votes)
13 views3 pages

3cs1109 Ir Rpr December 2019

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

3cs1109 Ir Rpr December 2019

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Nirma University

Institute of Technology
Semester End Examination (IR/RpR), December - 2Ol9
M. Tech- in computer science and Engineering, semester-r
I
I\'I. Tech. in computer science and Engineering (lNS), Semester-I
/
IrI. Tech. irr compr.rter Science and Engineering (Data science), semester-l
3CS1109 Complexity Theory and Algorithms
l4ai( Marks: 1oo Time: 3 HOURS
Roll No. Supervisor's
initial with date
Instructions: 1. Attempt all questions.
2. Figures to right indicate full marks.
3. Draw neat sketches wherever necessary.
4. Assume suitable data wherever necessary and specify clearly.
5. Use section wise separate answerbooks.

SECTION I
Q1 Answer the following
[17]
CO1, A. Formally define various complexity classes viz. p, Np, Np-
L1, COMPLETE and NP-HARD and discuss importance of these tgl
L2 classes in context of algorithmic complexity ih.ory.
B. Solve follorving recurrences (anv onel tSI
1. t(n):St(n-l )-6t(n-2), if n>=2,
t(n)=n, if n=O or n=7
2. t(n1=n1z(n/2), If n>=2,
t(n):l/ 3, if n=l
C. solve following recurrences either by using Master,s Theorem
or by using Extended Master,s theorem Lppropriately {any t4I
onel. (Answer should be asymptotically tighf Uorrra.l
1. t(n): 2t(n/ fl* trn
2. t(n)= 9t(n/3)+ n2/log2 n
Q2 Answer the following
lLTl
CO3, A. Develop an algorithm (with time complexity @N") to find all
L6 tgl
divisors of a number n.
B' Develop a recursive algorithm for Bubble Sort (iterations not to
be used at all ) and trace it on suitable example with 6 tgl
numbers.
Q3 Answer the following
[16]
CO2, A. Using Limit rules prove that
lBl
L3 2n2 +3n logs n +5n : O(nt)
B' For an efficient implementation of Kruskal,s Algorithm (for [gl
minimum spanning tree), which is the most suitabie data
structure to detect cycle. Justify your answer with a suitable
example and give proper compledty analysis.

Page I of3
3csttol
SECTION II
Q4 Answer the following
co3, A. Write Merge Sort algorithm and analyse its complexity for all [16]
co 1, the possible scenarios. t8l
L4 B. Develop an algorithm to solve. 0/ 1 Knapsack probrem using
Greedy Strategr. Trace your argorithm on forlowing data f* tg]
knapsack capacitg= 5, to maximise the varue in knapsack:

Item Weight Value


I 2 J

-l J 4
3 4 5
-- 4 5 il 6

Qs Answer the following


CO3 A. Solve the foilowing problem on the given data using Dynamic
lLTl
L3 Programming approach (complete trace expected) (any one). tBl
1. To find longest common subsequince in-given two
strings A and B
A = abcdabcab
B = aadbabdadabc
2. To find a largest sum sub-matrix in a given two
dimensional matrix M.
5-296
-24-32
M_ 693-5
-8-21-6
B. Give trace of Bellman-Ford Argorithm to find shortest path
from node A to all other nodes for the following graph. Find tel
negative cycle(s), if any.

Q6 Answer the following


CO3, A. write an algorithm for Breadth First Traversal (BFT) in a graph IL7l
co2, with a trace on a suitable example. Justi$z that ,,Brqnch and. Ie]
L5 Bound technique of deuelopment of algorithms is based. on BFT,,.

Page 2 of3
3cs)lo9
B. use Hungarian Algorithm and sorve the following exampie
where four jobs (Jr, J2, J3, and J4) need to be executed tB]
by four
workers (W1, W2, W3, and W4), onejob per worker. The matrix
below shows the cost of assigning a certlin worker to a certain
job. The objective is to minimize the total cost of the
assignment. (Complete trace expected).

J1 J2 J3 J4
w] 82 83 69 92
w2 77 37 49 92
w3 11 695 86
w4 8 998 23

OR
B. use Backtracking Technique and write an algorithm to sorve
B-queen puzzle problem, arso evaluate its tinie comprexity. IB]

************** ****

Page 3 of3

You might also like