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

\ l1J w

{'
s4 ffi fr fli w A
+'i,'
fi
r
USN s'
x
L7CS43

$1111,ir -"+qr.*-*."rlr- /'


tt' o u rth Semester
Fourth lt. lt. Degree
S em es te r B.E. fD eg ree Examinati'binl''Ji
Exa minafnnn loI Jiind-,.f-ri-fy'21
.fi$. d,ffiSl120 19
Design and Analysis gf,Algorithms
Time: 3 hrs. W' .,*tu*.Marks:
too
.e,,* .
"d
c)
Note: Answer any FIVEfull questions, chgasffis ONEfull questio@ffeach module.
(-)
.

Module-1
d
1 a. Design an algorithm to search#F#dment in a anay using-'sequential search. Discuss the
N
ca
worst case, best case and avgfuffia'se efficiency of this algoiithm. (0E Marks)
T'
0)
d
()
b. Discuss adjacency matrix afidfuliacency list representation of a graph with suitable example.
$<

ER
oo- c. Give the recursive solve towe^ orrunoi,problem. Show that the ."l:f.ffiT|
d-
c;-; "trn$i.d,l
this algorithm is expondhtiil.
-v=
cg !,
7\n
;lcoo OR
.=N
13$
a. Give the generalplan for analyzing time efficiency of non recursive algorithms. Derive the
trr \\/orst case analysis for the algorithm to check whether all the elements in a given array are
d ist inct. (08 Marks)
€: b. L ist and define an)' three asymptotic notations. S'hat are the various basic asymptotic
effic iencl' c lasses? (06 Marks)
=.=
't c. Explain the follorving t)'pes of problems:
(06 Marks)
c.lc)
cdO
o-o
boc
-.., L\)

a. Write an algorithm to sort'n'numberpusind"Quick sort. Trace the algorithm to sort the


follo'*'ing list in ascending order.
'-
80 60 70 40 10 30 50 20 (oE Marks)
b. Discuss general divide and conquer technique lvith control abstraction and recurrence
t^X relation. (06 Marks)
L. Apply DFS based algorithm and source removal method to find the topological sequence for
,= the graph shou,n in Fig.Q3(c). (06 Nrarks)

e4
'/. J

=a
)\'-

=
,J
IS Fie.Q3(c)

OR
v

J c.i
a. Apply Strassen's matrix multiplication to multiply follorving matrices. Discuss how this
method is better than dirgctmatrix multiplication method.
c.)

z l+ ,-l"|-r rl . (08 Marks)


d
li 12 r_J Lr
6)
b. Write recursive algorithm to find maximum and minimum element in an array. (06 Marks)
E
L. Write an algorithm to sort 'n' number using merge sort. (06 Marks)

1 of 2
tTcr-}
r.::j::lil:::i1-r':::ii::ii

Module-3
a. Write an algorithm to solve knapsack problem usirigfieedy technique. Find the optimal
solution to the knapsack instance n :7, m 15 :
(10 Marks)
b. find the minimum c: spanning tree to the
(10 Marks)

a. Write an algor{tfim}t'5 solve single sourceif$h$Jtest path Apply the algorithm to the
graph showg- irrffi.Q6(a) by considerin$,'ffi 5s source. (10 Marks)

'n ii

\'-t
.
, ._ @ Fie.Qo1gffi
Fig.Q6($$*
, '*'".ii'
"r,,,'",,
xp
b. Define heap. Write bottolftup heap constructkiii'algorithm. Constr[Ct heap for the list
l, 8, 6, 5,3,7,4 using-Qpdin-up algorithm ard sitcessive key insertion method. (r0 Merks)

a. Define transitiffi$., or,


whnse,diac.e{hfur{afrix
whose oiven u
adjacefi$#rumatrix is given. d ruM 'T
o**ffia,n",rffi.:*. matrix for the graph

[-rI O
n n 0 r1 nl0l -ttiiiii'.#
wi,,,,,'H
,,,:'i"''iiiilg
liriiiiil' i.+ii
Hlin:u,r-.
i::i,,,r, I ,.i1+i:*.'"'*, uE'

$u', 1 o o ol
v
***'.',i **'*'tut'
ii r':n:ii

I *+,,,.
0 0 1 1l*'u*,'"":i+i:i'i'i .:.+n
(10 Marks)

0 0 0ui .,q
.r.1!iilii!.r,

rji:.ii;;.1,- n
'"li:ii!,i.,t*..'

,,o ilH
"".ro..i,.iiii,,,,Li:i
''1+',

psing dynamic programming technique. The directed


graph is (10 Marks)

12.-
Fig.Q7(b)

2 of 3
t7cs43

OR
a. Write an algorithm to construct oottma bin searo
::ii

d for the
I
Kev A *$+*F*'# C D
ti{}iV'
Probability 0.1 ;ritii',r-
''i':-1iililil...-
'b!11\:*t
It . zr 0,4 0.3
(10 Marks)
b. Apply the bottom'up dynamic programq{qp'lgorithm to the foffiing instance of the
knapsack problem' Knapsack tff.fr: @
*
W,fli*n value
lffi
fff.s$F.r.".
q|trl?;'li:L
'i!1{-
'"+;}Ilirt';
;
a
J
;t;. rii 'qiiri
ra*:i:i.ill'.,iii"
li'4i!.
$
^{- '*ii*ii.1'.r",o

"
i,:+:+tiirtL, {liiil 1:ii.:il
-.:; ''+:i!.ii:r+.

4
.:,J .:.+ 'i:. .;i:r'

ttg*''.'$i '"%,si\n
'i..it!!!i[!./J

'ii ""ti
,,,
:+r4
ir..:i$'"
5 *25
.S
.l.is ,Si;i"
.!iir:if
n
.*'
..j:ii:!lit:iii:,
..t.to,,ot,,t,.
iiilii: (10 Marks)
$ ,,riiii:il,i.,r' ,ti:iililtr,,..,iii.f
tlffi''..l. .it. "t:::ii:ij.ji;.,s.,,,,

,ir:iiiii::::.:.*. i::illiiiii:n. ..t ii: ii:ilii

"ru
Ys&xr+jg
Module-S o+*+'$

a. Construct state-sgEgfree for solving four queeqp problem using backtracking. (06 Marks)
b. Discuss grap\ry'FHng problem. Find _@rent solutions for 4 nodes and all possible
3 coloring Rroblefi i\ Y (06 Marks)
c. Write u n'lUfutnr-(i) Non deterministic-i1$rithms. (iD LC branch and bound solution to -

solve O Problem' (o8Marks)

,$
f0 a. What are the two additional itgms required by B "" ^**
fi$dd Bound tecEiQue, compared with
backtracking. Solve the ffi-#ing assignrnqtt,s &Husing .bran4rEhd bound technigue,
whose cost matrix for ing four jobs to fo'tr rsons at e g iveri-u**'migp
[q 2 7 $T'*ffi
;ii::i"r'rl* '" 's'

lu 4 s nl
l' -g8l fu{E -re
E€'
(10 Marks)

lrtn 4j
e= $
b. Discuss$e 6tto*ing
(r) q$&sumproblem ti
{elHasses.
(iD ffilirO and NP corpleti -
:

$-$ F ,,.
(10 Marks)

1+LF
s 5-
,GA> .csqs
,ffi, p
* * t -jF.?i*"
-'€b't
a.k #,. jF € -aSn

futr''€
€= \ -"
d*w=
€-E{ E&
"€L I %t E
'rea. =rejs,.=i'",R.,.j.
F
-G.

eLt
t&
\tr

f,e

/&
*&F
d${ %**

-+till$i}ii,iil,:ili:1.

tei::'

-_4.4_

&F
{8"
4'
&

&
car

3 of 3
F&?
{,ly

You might also like