Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CS-501
DESIGN AND ANALYSISOF ALGORITHM
Full Marks: 70
Time Allotted: 3 Hours
py
nt
The questions are of equal value.
om
Thefigures in the margin indicate full marks.
h Candidates are required to give their answers in their own words as far as practicable.
GROUP A
.c
(Multiple Choice Type Questions)
10x1 = 10
Answer any ten questions.
1.
da
(i) Minimum number of color required to color a graph having n > 3
vertices and 2 edges is
ve
(A) 2 (B) 3 (C) 4 (D) 1
adjacency list. What is the time required to generate all the connected
components?
(C) O(e + n) (D) O(i)
xa
1 [Tum over]
5102
CS/B. Tech/CSE/OddlSem-5th/CS-501l2014_15
om
in merging two sorted lists of 2 elements is
(A) 8/5 (B) 1117 (C) 1116 (D) 8/3
(vii) The data structure required for Breadth First Traversal on a graph is
.c
(A) queue (B) stack (C) array (D) tree
5102 2
+ -\
GROUPB
(Short Answer Type Questions)
om
complexity of binary search.
4. Why Recursion Tree method is best than the Substitution method for 2+3
solving a recurrence relation? Find asymptotic upper bound of the
following recurrence relation with help of recursion tree method.
.c
T(n) = T(nI4)+T(nI2) + e (n2)
5.
da
Write an algorithm to find a minimum spanning tree (MST) for an
undirected graph. Estimate the time complexity of your algorithm.
3+2 10
ve
6. Given weight vector (15, 25, 35, 45, 55) and the profit vector (10, 20, 5
30, 40, 50) and a Knapsack of capacity 100, find at least three feasible
solutions including optimal one for the Knapsack problem of 5 times.
m
xa
GROUpe
(Long Answer Type Questions)
.e
Write quicksort algorithm. Analyze the best case and worst case time 7+3+5
complexities of your algorithm. Perform the PARTITION operation
once (one time) on the following array as per the requirement of the
w
8. (a) Write the string matching algorithm due to Knuth, Morris and Pratt. 9+3
Analyze its time complexity.
·r.
CSIB. Tech/CSE/Odd/Sem-5th/CS-501l2014_15
(b) Using greedy strategy, schedule the following jobs within deadline so as
to maximize the profit. Deadlines and profits are mentioned as follow: 3
Job i 2 3 4
Deadline d, 3 2 3
Profit.g, 9 7 7 2
9.
State the Max-flow min-cut theorem for network flow analysis. Trace
3+12
om
the execution of Ford-Fulkerson algorithm for finding the maximum
flow in the following graph.
12
.c
13
10 4
9
da
ve
4
14
m
IO.(a) Define classes P, NP, NP hard and NP-complete and also explain their
4+3+4
xa
3x5
(a) Strassen's matrix mUltiplication.
(b) Kruskal's algorithm for finding MST.
w
5102
4