Reg. No.: | a)
(a)
B.E/B.Tech. DEGREE EXAMINATION, APRIL/MAY 2010
FOURTH SEMESTER
COMPUTER SCIENCE AND ENGINEERING
(CS1251 DESIGN AND ANALYSIS OF ALGORITHMS
(REGULATION 2007)
Time : Three hours Maximum : 100 marks
Answer ALL questions.
PART A— (10x 2 = 20 marks)
L f(n)=n*+3n? +n+5 find O.
2. Define Space Complexity.
Differentiate conventional problem solving method with that of recursive
approach.
Write the algorithm for Fibonacci series.
List the advantages for divide and conquer technique.
Whit is Greedy-choice property?
Sort the numbers 3,7,4,12,2,44,3 using heap sort.
Give any two applications of Huffman trees.
Write the AVL balance condition.
10. Define Branch and Bound method.
PART B— (6 x 16 = 80 marks)
S
Serra Pp
11, Solve the following.
1 ifn=1
Th)= eae n otherwise’
Or
12, Explain the process of calculating the running time of an algorithm. Give an
example,13, Show that W(n/3) + W(2n/3) + n is O(n log n) using recursive tree method.
Or
14, Explain the iteration method for solving recurrences. Solve the recurrence
relation O(n) =n + C(n-1), C(1) = O and nis a power of 2.
15. - Write the divide and conquer algorithm for sorting the numbers (100, 56, 98,
24, 67, 0, 47, 11, 18) using quick sort.
Or
16. Write the algorithms for Breadth First and Depth First Graph traversals.
Trace the algorithms for the following graph (Start from Vertex A).
Fig. 1
17. Construct an Optimal binary search tree for the following dataset using
Dynamic Programming approach.
Identifiers : 0 1 2 3 4 5
PE 0.15 0.10 0.05 0.10 0.20
qi: 0.05 0.10 0.05 0.05 0.06 0.10
Or
18. For the following graph, find the minimum cost spanning tree using Prim’s
method. Also write the algorithm and find the time complexity.19. Present a branch and bound algorithm for the 0/1 knapsack problem. Trace the
algorithm for the following data set, no. of objects ; n = 4, capacity of the bag,
m= 16, Profit P= (10,10,12,18), Weight W = (2, 4, 6, 9).
‘ Or
How will you solve four queens problem using backtracking method of
algorithm design? Draw the state space tree.