Sei sulla pagina 1di 4

*EJ1220* EJ – 1220

IV Semester B.E. (C.S.E./I.S.E.) Degree Examination, June/July 2015


(2K11 Scheme)
CI 44 : DESIGN AND ANALYSIS OF ALGORITHMS
Time : 3 Hours Max. Marks : 100

Instruction : Answer any five questions taking atleast two from each
Part.

PART – A

1. a) With a neat flow diagram, explain a typical sequence of steps in designing


and analysis of an algorithm. 6
b) Explain the asymptotic notations used in the analysis of algorithms, each
with an example. 6
c) Explain the general plan for analyzing efficiency of non-recursive algorithms,
taking the example of finding the value of the largest element in a list of n
elements. 8

2. a) Write the Brute-force selection sort algorithm and obtain its time complexity. 10
b) Explain the assignment problem and give the optimal solution for the following
data, using Brute-force technique.
Jobs

J 1 J 2 J 3 J 4

P 1 8 7 1 0 5

Persons P 2 6 9 2 9

10
P 3 7 5 4 8

P 4 1 0 3 8 9

3. a) Explain divide-and-conquer methodology. Suggest a pseudocode for merge


sort and analyse its time complexity. 10
b) Explain Stressen’s matrix multiplication taking the example of multiplying

and obtain its time complexity. 10




  & %

 

) 

* 

 

 

# $

 

 

P.T.O.
EJ – 1220 -2- *EJ1220*

4. a) Apply DFS to solve topological sorting problem for the following digraph. 10

b) Write the algorithm for BFS. Explain and show the order in which the nodes
are visited in the following graph using BFS. 10

PART – B

5. a) Construct a heap for the data


15, 75, 65, 40, 35, 70, 50 by successive insertion and sort the same
using heapsort. 6
b) Construct an AVL tree for the following elements
1, 3, 6, 5, 2, 9, 7, 8 6
c) Write the Horspool’s algorithm for string matching and obtain its time
complexity. 8
*EJ1220* -3- EJ – 1220

6. a) Apply Warshall’s algorithm to the given graph. 10

b) Apply dynamic programming for the following instance of Knapsack problem


and determine the maximum profit earned. Assume Knapsack capacity = 6.

I t e m W e i g h t V a l u e

 ! #

10
!   #

" " " 

# # # 

7. a) Solve the following with node ‘a’ as starting node using Prim’s algorithm.


 ! $ #

!     "

   $  "

$  & #


$ & 

 

# " " # 

Show the input graph and the resulting spanning tree. 10


EJ – 1220 -4- *EJ1220*

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

8. a) Find the subset of a given set A = {1, 2, 5, 6, 8} and d = 9. Obtain its state
space tree using backtracking technique. 10
b) Apply the branch-and-bound algorithm to solve the travelling salesman
problem for the following graph. Show the state-space tree applied to the
graph. 10

______________

Potrebbero piacerti anche