2011 Daa End-Regular
2011 Daa End-Regular
Paper code--------------------CS-602------------------------------------------------------
Full Marks---------------------60-----------------------------------------------------------
Answer any SIX questions including Question No.1 which is compulsory.
The figures in the margin indicate full marks.
Candidates are required to give their answers in their own words as far as practicable and
all parts of a question should be answered at one place only .
(b) Find the Theta (Ө) notation for the following function
f(n) = log(n!)
(c) What is the content of the given array (15, 27, 8, 37, 10,
50, 54, 31, 85, 5) after 4 iterations of Insertion-sort?
5. [2×4]
(a)
Write HUFFMAN‟S algorithm and obtain a set of optimal
Huffman codes for the messages (M1 ….M5) with relative
frequencies f1: 12, f2: 20, f3: 10, f4: 35, f5: 23. Draw the
decode tree for this set of codes.
(b)
Apply prim‟s algorithm to find minimum cost spanning
tree of the following graph by taking „a‟ as the root vertex.
10 a
f 28
25 g
14 b
e 24 16
6
c
22 d 12
[2×4]
6.
(a) Write an algorithm for Building a min-heap and find its
worst-case time complexity. Build a min heap considering
the following array elements and also show the heap data
structure at each step. A[ ] = {10, 7, 14, 6, 5, 12, 7, 4, 9,
1}.
8.
(a) Write the algorithm for All-Pairs Shortest path and find
out its time complexity.