0 ratings0% found this document useful (0 votes) 162 views11 pagesDesign and Analysis of Algorithm Answer Sheet
design and analysis of algorithm paper semster iv panskura banamali college
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
PANSKURA BANAMALI COLLEGE (AUTONOMOUS)
INTERNAL ASSESSMENT-2021
Cover Page of the Answer Booklet (For online exa
A [rere eaninto TB SCH) bh SemeshrT banal Eval
2 | Candidate's Name: sat Mask
3. | Candidate's Class Roll No: be !
4. | Candidate's 1D: 2015 UG009670
5 [abe Comp utr Sclence
& | Paper Name: Design and Analysis of Adgoribhnes
7_| Paper Coder COET aaa
3. | Date of Examination: 18/06 / 202.4 |v a
3+ Regno Wilh yeah L019 PBC 00378 (2020- 2024 )
For Examiner’s Use:
Question Total
No.
‘Marks
Obtained.
n)
nahin
Instructions to the students:-
Students use this cover Page fr all the papers and units preferably.Use separate cover page for separate paper.
‘The above required details should be filled in hand written. Put the page number in each sheet properly. For
uploading the answer script (Contalning all the pages in proper order) should be scanned in Pdf format and the
size ofthe scanned copy must be kept minimum with good clarity as there willbe a limit of upload size.
Student should get the printout of this blank cover page (in Aa size only) and can make the required number of
photocopies ofthe page's.
‘Start writing your answer from below the dotted line.
Ole ke Tenchi =y The Mebame,,
puncbion 5 45 one of- Lhe mask Jonperte rd
[pune bins an Comp ubr Acience ,
6} is Oo da ssccuanple f- Ane,
OgPrvthive a : mute
Neewsive funcion. Sb poms vo
os he Size of,
The Juncdsion
Uno Pheer
y quelly yn Value
‘s
is us wally define ol as.
ned if mao
AUntyh) 772 and n=O
he Lends AL 7-4) KL m0 £90
Shs wqument’s are Neva- negab' ve and ef
always amin obs
t A named a. anonymous unchiore fakin.
bine iteg od os input, Neburringe On inkegeh Smee
A pre arn taleing- tuo Apace oF Neuthine
separated jnbegs 0% STorN> prinking a Desh
fo STDOUT.
Exorple --& C1,2)
Etort
Hoe M=45 nied £070
Fe oppving Pd condibion, of Hekedren furrel
-fAc 0, A442) —-
wy Ld fod Acs sD
Now ls fu op Co AC) -- @
Now! Lids pod Ath oJ
ee7 find A (a4) ©
Acas) oc Itle Das
ut bhis Value 40 eguabton (ii)
ae
eguahier Cit)
Now P
Monee ACA, os
Now put hhis Value da
bh O44 = A (0,2) W@W)
Now Ids find A Co uJ
A Cw = 24/23
ee py Value in LIV)
lied) =3
No Ww put Lis value an equabies Ci)
Attu =F (op) - “Vd
Now lds fond Me C032
A C43) =3+l1=4
Now pw this Value
Hence fb 6 4/2) = 4
Pl gente of Tawa of Hove 95
Se it acai:
TVWo war d Hanaty us a mabhemabical puzel,
Lhob consists of, bhee found. These re
2 c gual, Vv)
GAS of Van yin izes and Aha checd |) aa win ascending andar. Z
Ruls— @ The to disk Can be moved anl,
P y
6) only one dike Carn be moved aka \
hime.
© Large dith Sils above anes
B mall disk
A goithn to»
Shp 1 + spat
Jove bab be Mie toe be ble tuts
— dut QUX »
Shp 3 7 Read he numbr of tte, n from
2 Lhe wr. r
Shep 4 "Move Ca-1) disks fren Aource fo
ee aus. :
skp Ss: [ove n bh disk bom Aor le bo
— deat.
eee Move e-y dishs [rem aux to deaf r
Lipt: Ree sbeps 4 beB, by decom
oe 3
ooor
OQ
ce eae algailhn -
) Considd Uree fowrd Source, ve au
and alee Value of, disks [rom Piste
@) Now We move all ae ghee (n-dchsly
One by one [pom Ao) Ce o AUX
(i) The Lorgesh disk is It at be Boudec,
Which 3 Ler moved be the desk Peers.
1 Thea again Lhe neat af Lhe clisk a fre
igen back dpom AUX fo Aowte,
&) Again Le Same shps Ore ppetd So
Thode alt Hhe inks oe moved te Lhe da
|
bows.
A) Bulle Semk fay Bull soli @
d bruk force Sorhing ee
Lhe easiest 27
Sh is used te Bort temebts in ail
descendin hd de WA ad cendin
fn datading BAD Evry denet ist
mpored
suibh ewdy abhte lemenh dn Bubble’ Sen
2 4b basicall de . ,
ly does Aviapping des
Lhey ahe ne PARED it Noi 7 : up
On Lar Value ond Lhe jaberded ond Pedi
A
Neosho bop with be uted bo ao)
at Ll.: @
Acudo Code i
©) We wre given wilh an Inpub oWhay which,
13 Auppated fe be Sorted inn AB een ding adn
Qi) We Aboat Wilh Lhe pst erme nf- aksog
in dex on a if phe clemest- ot(i+4 J index B
grt Han ico index, We Swap be chneks ,
< gue is nd Lhe Case, ber no Swapp
© shes a
bed and the above
ds incre
a gat until May Is exhauthd.
dgnare bhe Last Index as
W Mow i gO
Cee
0) We sdk
cady Sorbed.
oe Lp willbe of Lhe |
Te wiih og adne shiso a. Mf
wilh the Same Aheps bhot wil{
ee ak rd
ee Lut 2 Ardy
trae 3E : Si
TRenpk o> Connie fom = (4) 33, 24,35; fo
ie (4, 33, 24/35, 1o
As 1433 folbe 10 Strap hapors
19433 2F 38 10
43724 Hue Swep A append
. (424 33 38 lo *
3a te febe ne 5 v1 op happe
> (429 33 3s /0
35>/¢ fia trues Swap hoped
(424 aa le 34
ccond >
Sev’ TF (4 24 33 Jo 3s
lay. 4 pobe re Sweep
24733 jabe no Seay
33) /o tue Swap htpe
Now, [4 , 24, 10, 377 Bs
Thind po — (Abo Le bard PY Me
Lhad Ladget deme Wills Ye Mad Jays
posihi on in the ay
19,0% 24,233,235a 2
Ch paw ro [fen bre 4 bk poss, He
aw bh Lotgat plement will be at the fb,
barb pusibien .
ok petty Ajfn n He pus ben Lh
[agak clenes (Snood clemet-) oll be of
Th fost pilin CA ah prsthin ) in the
. Whre n 4 the Ave. of. aha y
aS
| by Wilar
Apa dong ee te ee Sahel
cantly S* the May
33, 35
10, 145 24>
(3 Tame Complexity Bina Seat eA
Mg erlhn $= Binary Search 45 a divide ancl
Cangun algorithm. Dinide ond Conguan ia
algondhn poredign technigue |
() Divide
uv Cong ur
M dge.
Gn2)
[ Amay must he Shed L4g de the
Abaling ond lost index Depedinly ,» is bh Aize
of. khe. aihay eee key
Ba Cas Gfsa &)
[ ee => OtL)
Up aDite=k
bin é
dee dian 4
ose
mids lisy/, =p oy)
Up almdl os k 7 o(4)
nebwan mi ot
el e
‘ if afmd] > te
prelwn BSCOsmid-I e)>
ol TO)
ak BS ( amidy4i, LJ =>
C TCp)at oe
Time Canphnily "ay
ieeetade
_ oe
Gane (pe > 41
T On) ==.
J 4
ea ical
/\
1 + (he) REE
aCe a) tea nee
TEpe)
(va Sune kL Athy as A
Aye a4
ANS oe
ee
-khog 2
” fogn =
nN b= Hate tea)
So the Lime Conplexthy 4 0 (heya )Best Case — C4)
BA vira se Case — 0 (leg n)
“Wenhowre — Te TOV) $e
— By usin mash. Header
O (logan)
See