Professional Documents
Culture Documents
I
I
Eft\rr
\
TJSN 1scs43
=E
rJn
a. Write an algorithnr to,find thc nraximum clcmcnt in an array of'n clcnrcnt. (iivc thc
u mathematicsl anafrTsis of this non-recursive algoritlrm, (06 Ntarks)
,
Il_
.a-J b. Explain the. asymptotic notations lligO. IligQ and big thcta used to comparc ordcrs of'
ofan"a,igorithm.
(n A\
L1)
(f.)
Cc
,1
n) l. (05 Marks)
c. Dcflne aigorithm. What are thc criteria that an algrtrithm lltust satisfvl' (06 i\{ arks)
') i)
,. L.
E!_
Module-2
?5
a. Write a function to find thc maximum and minimum clement:i in a givcn arrat ol'n clcrncrrts
\ by applying the dividc and conquer technique . (06 \tarks)
'Io
't-
b. Explain the divide and conquer technique. Give the lieneralalgorithm I)AndC(l'})lWhere I' is
c- 6- the problem to be solve] to illustrate this techniqu'r'. (04 Nlarks)
,JC U. Apply source removal method to obtain topological Sorl for the given graph in Irig.Q3(c).
.t 'Y'/
(06 NIarks)
!s
3c)
nr1
i* 1)
)\'..-.
ooc
c o{J
+ .L)
tr
Xt)
5s-
U
* c.i
C)
+J
c
z I.ig Q3tc) ,
Nfl
ll
. ,'
, ..'''
d
+-J
L<
c OR
-r
'.= a. L,xp lain the merge sort algorithm. llr"rstratc
I with an cxamp lc and givc thc \/ol'st casc
ieni'y 0 f merge-s011.
c fYic (0ft \Iarks)
b. ,4ppiy quicl< sort algorithm to the ftlllow'ing sct of'numbers"
55, 7A,75,90, g5' 60" 55, 50, 45" (08 l\1a rks )
I o{-3
l5cs43
Modul*ig i
a. Apply greedy method to obtain an ,;oiution to the knapsack problern given M - 60,
lpfimal
(wr, w2, w3, w4, ws) =- (5, 10, 20,30, 4tl) (['t, pz" pi, P,t, ps) : (30, 20, 100, 90, 160). Find the
total p rcl f lt earned. (04 Marks)
b lixplain Iluffman algorithm. With an';example show the construction of Huffman tree and
generate the l-lufThan codc using ihis tree. (06 Marks)
c. Apply l)rim's algorithm to obtain a minimum spanning tree for the given weighted
corrnectcd graph^ [Fig.Q51c)]. (06 Marks)
li
F ie Qs(c)
OR '
a. I :rp la in thc botto m up hcap c0nstruction algorithrn with an example. Givc ihe worst case
I'is Q6(b)
/j
'W
a. Lrxp lain mu lt istage graph w ii ll an exam[ lle. Write multistage graph algorithm using
bacl<ward approach. (08 Marks)
b App ly It loyd's a lgorithrn to so ive all pair shortest path problem for the graph given below in
I'is Q7(b)
(08 Marks)
I"is Q7(b)
2 c>f 3
15CS43
w"q -, OR
a. fxplain Bellman Ford alio f ind s ing le source to a I destinations 1'or a
shortest lpAtli {iom I
,...-,:,r'.,r,
' Fie.Qti(b)
OR
10 a. What is Hamiltonian cycle? Explain the algorithrrr to find the Ilamiltonian'rycle in a given
connectecl graph. Write thc functions used fclr gcncrat ing nert vr)r't ox ancl for llnd ing
Hamilton ian cycles. (09 NIarks)
b. App ly the best-first branch-and-bound algorithm tp so lve thc ii'rsta1c1 o f the givcn job
assignment problem. I (07 }Iarks)
[7 I'erso n d
:irrF*i<*
tl
3 of 3