0% found this document useful (0 votes)
15 views2 pages

Document

Gjgnkobk
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)
15 views2 pages

Document

Gjgnkobk
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/ 2

109 109 109 109 109 109 109 109

Registration no:

109 109 109 109 109 109 109 109

Total Number of Pages: 2 B.Tech


PCCS4204

4th Semester Regular / Back Examination 2015-16


DESIGN AND ANALYSIS OF ALGORITHM
BRANCH: CSE, IT, ITE
109 109 109
Time: 3 Hours
109 109 109 109 109

Max Marks: 70
Q.CODE: W480
Answer Question No.1 which is compulsory and any five from the rest.
The figures in the right hand margin indicate marks.

109 109 109 109 109 109 109 109


Q1 Answer the following questions: (2 x 10)
a) Why asymptotic notation is used? Outline different asymptotic notations.
b) Is the running time of merge sort depends on the value of keys in input file?
Explain your answer.
c) Find the growth order of n, logn, 1, nlogn, 2n, n3,n 2 in increasing sequence.
d) When best case and worst case partitioning will occur in quick sort?
e) Differentiate between divide conquer approach and dynamic programming.
109 109 f) Why greedy
109 algorithm is used?
109 109 109 109 109

g) How does kruskal’s algorithm know when the addition of an edge will
generate a cycle?
h) What is the basic objective of Rabin-Karp Pattern matching algorithm?
i) Consider two sets set-1={b, c, e, h} and set-2={f, g, d}. c and f are the
representative of set-1 and set-2 respectively. Show the linked list
representation of both sets and also show the union operation of both list
obtained.
109 109 109 109 109 109 109 109
j) What do you mean by approximation algorithm and approximation ratio?

Q2 a) Solve the given recurrence relation using master method: (5)


(i) T(n)=2T(n 1/2)+lg n
(ii) T(n)=3T(n/4)+n lg n
b) Write down the algorithms for QUICK-SORT and PARTITION procedure. (5)
Specify the best case and worst case time complexity of quick sort.
109 109 109 109 109 109 109 109

Q3 a) Write an algorithm to construct a min heap. Construct max heap from the (5)
following list: {16,14,10,8,7,9,3,2,4,1}
b) Write down the algorithm of binary search. Show that the worst case time (5)
complexity of binary search is O(lg n)

Q4 Write down the algorithms for MERGE-SORT and MERGE procedure. Prove (10)
109 109
that the running
109
time of merge
109
sort is ϴ(n lg109n) . 109 109 109
1Page

109 109 109 109 109 109 109 109


109 109 109 109 109 109 109 109

Q5 a) Write down the algorithms for BFS and DFS. Specify the running time of both (5)
109 109 109 109 109 109 109 109
algorithms.
b) Define LCS. Write down the algorithm for computing the length of an LCS. (5)
Find the LCS from the given sequences X={A,B,C,B,D,A,B} and
Y={B,D,C,A,B,A}

Q6 a) Find an optimal parenthesization of matrix chain multiplication whose (5)


sequence of dimension is < 30, 35, 15, 5, 10, 20, 25>.
109 109 b) What is 109
Hoffman code? 109
Write down the 109 time complexity109of Hoffman code
109 (5) 109

algorithm. Draw the Hoffman tree for the given node values: f:5 , e:9, c:12,
b:13, d:16, a:45

Q7 a) Write down Kruskal’s and Prim’s algorithms and also specify the running time (5)
of both algorithms.
b) Write down Bellman-Ford and Dijkstra’s algorithms and also specify the (5)
running time of both algorithms.
109 109 109 109 109 109 109 109

Q8 Write short notes on any two: (5 x 2)


a) Lower bounds for sorting
b) Knapsack Problems
c) P, NP and NP-Complete problems
d) Floyd-Warshall Algorithm

109 109 109 109 109 109 109 109

109 109 109 109 109 109 109 109

109 109 109 109 109 109 109 109

109 109 109 109 109 109 109 109


2Page

109 109 109 109 109 109 109 109

You might also like