Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

*BE160* BE – 160

IV Semester B.E. (CSE/ISE) Degree Examination, December 2016


(2K11 Scheme)
CI 44 : DESIGN AND ANALYSIS OF ALGORITHMS

Time : 3 Hours Max. Marks : 100

Instruction : Answer any five questions, selecting at least two from each
Part.

PART – A

1. a) With a neat flow diagram, explain the typical sequence of steps in designing
and analysis of an algorithm. 10
b) Explain the concept of asymptotic notations, indicating the commonly used
notations with examples. 10

2. a) Give the general plan for analyzing the time efficiency of recursive algorithms.
If M(n) denotes the number of moves in tower of Hanoi puzzle, when ‘n’ disks
are involved, give the recurrence relation for M(n). Design and analyze
the algorithm for the tower of Hanoi problem. 10
b) Find the optimal solution for the following instance of the Knapsack problem,
using Brute force technique
n = 4; M = 6;
{W1, W2, W3, W4} = {2, 3, 1, 2}
{P1, P2, P3, P 4} = {10, 15, 12, 18}. 10

3. a) Explain Strassen’s matrix multiplication taking example of multiplying


⎡ 1 2⎤ ⎡8 7 ⎤
A=⎢
5 6 ⎥ and B = ⎢ 1 2 ⎥ . Obtain its time complexity. 10
⎣ ⎦ ⎣ ⎦
b) Sort the following elements using Merge sort :
535, 333, 456, 378, 498, 488, 512, 215, 178, 413.
Write the algorithm and obtain its time complexity. 10
P.T.O.
BE – 160 -2- *BE160*

4. a) Explain the three major variations of decrease and conquer technique, with
examples. 10
b) Design an algorithm to traverse the graph using BFS method. Show the
traversal for the following graph :

10

PART – B

5. a) Write an algorithm for presort element uniqueness in an array and analyze


its efficiency. 10
b) Construct an AVL tree for the following list of elements :
25, 21, 28, 24, 27, 26, 22, 29, 23. 10

6. a) Write an algorithm to compute the binomial coefficient using dynamic


programming technique. Compute 6C3. 10
b) Apply Floyd’s algorithm to find all pairs shortest paths for the graph shown
below :

10
*BE160* -3- BE – 160

7. a) Apply Kruskal’s algorithm to find the minimum spanning tree for the following
graph :

10

b) Solve the single source shortest path problem using Dijkstra’s algorithm by
considering ‘a’ as the source.

10
BE – 160 -4- *BE160*

8. a) Solve the Knapsack problem using Branch-and-Bound technique :


Item Weight Value
1 4 40
2 7 42
3 5 25
4 3 12
Total capacity of the Knapsack W = 10. 10
b) Solve the subset-sum problem using backtracking technique. Show the state
space tree :
S = {1, 3, 4, 5}
d = 11 ; 10

_______________________

You might also like