0 ratings0% found this document useful (0 votes) 30 views24 pagesADA Dimple
Analysis and design of algorithm
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
Sulh ¢ Grehitetuste
wy gus
, « execution Hime va a fark bn? Cytnd=
we 1 wutnes QC anh 4
thet , ques pie 0 gtr?)
y ¥ ag yom sy
: fag th at
4 aynte . emer’
‘ ae tba
36 <
z M8
v lui ty thew
i.
n 4(n) a” gt net)
; 2 4 fin) > Ow
: I 3 n> Cnt)
et wun Me!
amie 8 1>,e(84a) = uh,
Vg c
iih ten (6)
flr) = 0 atn)
urchen Yn < Chgtn) < Jin < qe)
Sue in) = ang
i vgimen. then yind the andneses a Gy
fm
eu
se
aust uthen Cy = 5
8 ’ gr) 24m)
MW 3 Cet meh
ay Cass Var rere
4 5 Not Cinttiol value), sa te
tn) )
fe eo
finan Tera ace. to condition
i
: fl) >4atn)
d 8 ne a
Ge!
: tr ot, LO iG o
1 On) < Cy (h)
5 ia eral
Asymtotre Umit
it tim 100 29 * big 0 (yoo)
PG)
if lim tx) _ 4 (gon) t )
13% FTG) Sy iN Ve fy
i lim fO) | PN :
_paoonon9peetdat
Meme
(x) ea
du J00= Seta g
lim (36 -5%
lin ee by
a ramen tt
a
gh’)
19
> f(n)* <1
lim 3y—5
nro XS
fu : gies
: = dim
1 0
val:
= Joo - 0 ge)
Gur Prove that an? #5 = 0 (ei)
tim atnts5 oy lim tpt 4 5
nee aoe no ne ht
= O40 =0
fi non
le Ope
> ti
2
Que: Prou that n*+5 = @(n?)
mu ig fin) APH, ainda?
Gus: st fc Sra
ne gn eT
Gus, 4(n)= lah 1 gird= if
= Log h im
puree a ae
eee Space Tredeoly a
a that the en “he apeee
% ee ortion i
atte a {space TRADEOF st
ne
= Tim gen
sdithos in les ed
+ dh vy Ute spacenti) = Gi Th)
LO hae 9s
Tin)= 1% )4e —@)
put ne My
TOM) = 1( Mg?) 40 —O
poe he Ny
Thru) = T( Nfs) +¢ —@
TOY = TNA) sete « T(N/a9) 4 96
Tin} = 1 (743 od
‘ )Fc40¢ qe!
Te ii ("a¥) Hale iene z
Uthd= TEA kY +. ke Ca
> 14 Clog n ba ben |
- 0 (leg sn)
du. Thy: $0 2
TU)
Lerten If note
Teh) = ATM) ey
pues n= by,
14) $0 (49) yO
pet n= My
TM) =a (fa) HY:
ium,
q
ttn) ‘(3 1s) + Bad
3 co) tM EW
Afar(ms + qT] tae
17 UY) bh tae
v
va the valuu from eu (1), w 4 &-
a els) an) aa y :
eee enna sslogins [9
ete (gn) § nlegn
~ nentoge
o(r pp)
) 1 tray
(1th) + loyn nol
gi
aoe 2Ttn-)4 ae — ©
ave howl
tint *) T(tn-t- )) lylrd) &
tert) = Tra) eben ©: hvk) + log
Que Tin?
pit =n?
ttn-2) = TUn- 27 2) 4 Log (Wad).
=a Deyn sy pe .2
Nexc—-rtnd= ‘ fe \oq (hn 10: Kt
: Bi ( Zz a al
t(n) = Tin- nel oe ley {rest |
eerie 3) | + a =a) a Deere
= ae,
2 T(n-k) + Io (e-1) + Leg [ -
toh ei ye
= (eh Weis oD)
wv ,
Ve tag v
(+ Wlogn Why
\
on Loy)ae
a Tin)= J 2 ret)
rena) ene M2
gee e1(Ma)an? —A)
TUMa) = 81/99) + —®
T("y) = 51 (7/33) iid oO
TC) S8e(ar( (ns 4) yi
Rein + io cn ,
= grin} 87 TR) 4 an? th? ‘
Tn) = ue) + 3nh ro) ORS
ae ody oa
S + Br = gy
Hina’) + Ea
= OF (n/gs) + BN ey
= gy (/) + §3n> am |
Gu. } aq 7) 0 \ ale 4
aTJnic Me *t
ee ERERAEREE
, h.- Aly
ies) sdTAntie — pale sy
putt n= Jn \
= dijon +¢ , ae
) Bt ca a
My = atl) ecd
(*roph st). 9aa ~ co
Tals!) = a7 (nye ey
Now
TCH) ‘oe
te +de+e
i ‘Tartn) "0 te)saere
~ tty (n'a?) pdteaere
¢
g
ee wy OT (pak) yaktog abe +
new Petting the wolucs
: 1 ®,
Tse T(0 ney aa Roy gery. pattaletate
legn (2) eS Stok)
ty + c[at-
ent ¢c fg atl
> ayn legn
Time comp text — OU yr) ¥ 4
Qu tn) = { 1 ru) OY
( X
AND oe a
=
=
2s
2
5 giueh, Ten) > &T(%) ¥en —@
° the Hone Ope a pra
x tne MEM +---- 4 i
Iotght of bin free U Ji uan h
: OS nie dnt J FS
»
0h) vee
» Gu i Tate) 41(aiyihe » a
g a , 132
pin, ke a
! aye rues
logna Alo (3 th,
logn> leg (84 ae
[Mayr = “Time omy lenTh)
oft
esc nd me
giuen, Tin) = 37 (Ihfyp)+ an? =
vi = ie cb
Wine Wy, yy nt we Ya Ge
it a fy nen
7 vt a 5, te Mp coe = .¢3n
“yz
ng = 1 = lens Ay’ :
7A loan = ak ga
tortie) © ‘ ee
ke log w
Now, keen2 dae caeny
gt eo =0 (n? las),
ace.) ihe + nis ey oh
= cn? HY.) + + (5) mig wo
mle] Bey eohiallge
ow aE ‘ j
ee ! |
a J i
[lyn- | 4 Aye 3 Kon = (toa
es 4 (0 3)
ie ie 5
(1, 0
nel AMERve
TVUVVedobb
rt)
@ Tin) =
leh vais (4d + (S/5:)3-
Mf Bey i th [iva (4
: t 5a dl ( a3 es
_ i ae \ at
pe hlepeterst= \ naa
( q | Rite bisq5
@rm=: § 4 cee s2ka|
} 10%) 4 1(8%) tu USCS
r a
ie . hye
—— oe (a) ,
wae lagna blea(%h)
foe & BE Weay oe
. oh
cn leg => o(nle
uM a" evar &,)
Master theorem
Cats theorem J another woy of talculetya time ummolents
7 bud mate theorm une for sume ATH Hien reg ORY
[ axl,
Tin) = aT(%) + O(k ‘ya ¥ hyo
dos the obow. gustion
© = eluate “the O “amp “ae by ie
: Yowremcolton fer Marta feerevn :-
CY WY ar pk then: thn) = Bone ay
Wy aE ae bk dan |
Hey ayy pr-t thn th)= 0 fn ln Jeg tl
by pe- then Tl) = Pena My iby Mi
oo pei tw th= oly nbyay q
iy bF How
ti er hare ttn) = Olpk lata)
b) pxo, tn Th) = O(nk)
Que Tn) = 4T(y) +n
qe, T= , bed, kef, pro.
Ace. ty qut > argk
> tlh) = O(n Yn)
Th) = 0 (ph) wu.
dus. Tin) = 21(%) +H
M=8, beg, ke a hie
aCtete quer Qe 25
= Ns F = Tln)= olalts
The) S(nbae. leet
Tin) = 0 (lea)
du, Tin) = at (4) or |
Q=a, bed bel
Tn) = en ".
O(n ae
eee asad
ek
oi aWare:
Gu Tom) a7(%y) 1-2
Teg
veo)
(n'9")
o(n)]
ty.) +b?
Gigs
bed, FEa, p i
aXk*
=O o-{n tie)
sin}: 9-4 42)
% Tales
Que: Tn) => a7(0/,) +b?
Tin)= tnt)
[Toye salle.
ji gi b= ai entice
Tind= te O(nk lo tn,
itn) = ied a.
!
= b¢- suman,
Gye ax b
is = abt me
2 obo
sf Giott qn" *10}
pee clewa - multiplication (A,8)
iy Wal =#] 4B Ig)==0
ahirh A* 8
¢
ne max(IAl, fs)
ae pe. leu. rut Weéation (41, bt
Be De- tein rusepbiotn CaN
“els
x= pe~ dew ; rasan (otal saab? ai
(aad Fy Bis (oh +
hehon Cyto” + Ce Cae Fete aahyr fe nee
ia be
C= De~ cleus
> [Ca 406) * (by + by) ~
Cy (8x43 = 516
Co > 8YxXay = Ary
t= HEXGY=R4A44.
Cou” we
a + G10 + Co
Blexto!
= 5asusyy
= Matix multi alon (Strawn)
[a ay 7 he by
| &.
[ dg, ee. it 2)
[Aer ing [ber beet, [2] ‘al
Gy = Mp Xb) + Og X bg,
G8= Qe bia + ane x bya
Sy= Ber x bts + Vay X bay
= darx bgt Qyyr Rte
be
[oss arr 3 ayy aru fn poe biy
ba ban! bos bai
4 FI x1? £aAqyy
au
ny a2 Ags Way
Jog, G3, O33 Yy
2! i “i af a by ba ae bay
Tlh)= 81 (a) + 4h?
Stromen’s formu.
P= (Ay + Aea).x (br) +Ba1)
is (fray t Aga) 811
Re Au (Bar Bay)
$= Aas (Bay > Bu)
The: (Ant Ata) X Baa!
U> (Ay Au) (Bur
B= 3 i n=
G= bc. ie m sulkptadon (12143)
cleus mruttrpliatioy (34,21)
runltiplttatin (40, by b)
(a % by Hay x be)
E (nen)
foo | tay bb bay) ; Soy kbuetexbay
dae
Oe ie te \
(i=0; i435 be)
or (f=05 Fong jt)
i mba Jeo J
for (Eo, ne ie
mUtj]> AGTEIX
Sk] xq;
1m (A.B)
&
AN
Vg eau ryt Qa xbo2.
Cy sQry Abu HAzXby
Cs edatxbat dark bar.
vey TMA Up Ba ye
Mm fu Basha) +N (ia Bes
ote hank By): +My fbn Ba mg
MM Lar Brat)» fy (Radha D)
A. fe nie Az) «a 4 Ba:
se 7
me 4ty = PdS-r4y
Giz = RITA
Tth) = yr(%a) 4
Cy ep ie ee
)
Pp:
8-
£2
Wh]
(fs)+E a
Ay) + Aaa) % 81
Te ols)
Terdle J
4a, (Bap Bn)
wid a] *
> (An +n) ae
he
Ca = 44
fog? PIR-QYU
len?
Pp
3g:
rie
$
artes alg
P54 CQ) HAF d= AQ
jt Maar (By) + Baz}
]
35
a
q
8
a lan
¢
“(9 +
[
ae
aay
bY
ate
o~d
orl:
, part
IB42
5
T=le
uslo
v
23
“ual
]
ca
Bra
to
so
2044
3043
“ay orl
ota
ta ay
I 38
6 i
Wy
ad
to 10
rte 8?
sie
5 Gy tty Sree
yy Ce 13099
J= CAgy~ And: (84 By)
op a fi eee, ea
We (Dyp it ‘ a aaa
“(SVs Be Gd Gata]
Cy = PeS-Tty bf eis
Pes Tae » att f) Ea]
= [: | -_
~2 19 A
Cg= RYT = ro 4 tO 207 £6 at
[5 y oa i? [3 6 ]
Cyy = :
oes Ee 12 +fh ‘] Hie &J
Cag = PER -QtV hts a
= fla ay ¥ 4 )
[20 alts y al « pat rl
- [-4 a vb A
[-15 3
4)
= [EG ome
=) 19 eee
Ses fs
Ib ag “3 ; =
. “| ea
e e
‘ e
‘ 6
, waa
+1 «
| % lig q
| | \ oe aed
i uid(hae
Knapsock Problem + Fractional (a pox com alto by stared
dus eds
Hous
THe @ thee 3
prefit, -¥R vo ( 16
mutt to } 40
c ® grey oheut profit @ gredy about mayb
i bee :
1 [| peyites } i 04 go 4 (2) x1e
L 4 | 2 |(s = aosue
- L : 3u8
im L
— D prody about oe ee
te PEEK HY w 1OXEG o
Tse -
= 20+ G3 +16
item
ay (Ss
ais 10
8, AP os
about ferojit
psa J is
ie @® gant aheut wy
wit? 3S. aurdse 3h
@ Buds, abeut sgh [ regi
¢ ¢i int PEs) = fos. au tst
sien hte) jue w(3}> fig, stot
(ms¢, and twj optimal Birpay
ho " eo {fie tn) at
. ° > Trotting salu pnaus
nit , fitobkw
=e liability pati
1 46. Bo yy
6+ 6d 4 FID
3x2 GB ast
Hy (a Bie
@ wee ane
Tal cosh 8
e+ EY 4G
~ Reviabilihy dejan ew Moxa a ois
— Di~ Dar Bs, eee
dlal ale 8
ie By = 200 (1-9 wax 1 muse
1 Ba \o
von Ca wecled eg
=
topy tefk = EMG
| EB =
t= 105 duwited_ “>, 20) (0 *, 6o)}
ee oa ge
babnli ti- (-B98)"
= [sets (6 492) st 4 Anion).
one
= 4 (0/864, 60) (oomsou 9o)} oa
{ia 3) ee
D, = 0-361 65) ( s (OrU82 , 80) (oh 52406)
ri [ey
OSH 2
al
e
e«
«
«
«
«
«
'
)
>
P fouyoqs as
~ {Coun (aay anes # am
icc=F Trautling aalerman problew
The trauctu'va! gatesman Liem ohidt by w ralaman anol o
set yy corfu’, the Nn ha do wis tungow 4 Ha
utie starting umm o ceutath one and fo Atuun at
dhe sane Wy! the chaUenge yy the problem jc thab:
trourlling saterman need by minimmite the dota! oct of
the triph ft (Ral
. wile eh aie
aly 8) a \
5 a Y BY nu oe ial
| ee 2 \ es oe
NY
CaO A \ eo ee ane
greedy roath = [1 §—» 9-4 4241)
g lal eos > (batt teed ‘
= by Brute forte method: nears i
® ga ladete tb
@ vrrtyad®
@® yastyeye
Be e234 2b
® gyit2+)
oH
Gadd
(31)
_____
Tspli,s)= Clk) 4 isP(K SLR)
ria 4
e pera aut y uate
kes, 'S#G 0, CC)TO, Een)
ml 3
1
(f3gy (13) 4 Tsk (3142549) C14) + TS p CG ALR
1 1
a is 2 eo
CCayyyy C2) ,78 (3, (eam) efnY)
Teel ty) sf rele)
claws ely) (42)
TsP (4g) «TPC, tst(4d))
a iad.
2 e(4n) “ae
ww \
[9334 S21 236
x0
greeely approach :- 1—72—-Y¥—>3-4
= lO HOFOH5
Total tot = 56
& brute fore method:
10—
= cm
Frowultivg = Sal man TCs {23044
Als. 20.
eteada Top (8 dat
, ei suid et) septation
chat,
ssp le Gy) Ne
4, L
aa ctu) otis
tue) asetaia) sen (a
ut hay
Nes] fo} 3
gresdy apfrreoch
Spee Bed oe 3
total test
wee tn Lely eoams{sin®
NV RESIN,
tye) & Elegy)
vey e oa
t Ores Bia byl
1) = min aon »
ctn3) + M8 123)
‘dade cous ms (204) aye
a ns (ts) 9
ee
am s(43)t2 ee
{
be 2" 09 B 8 ms (842
eta) pasts) 9.0359) M803, 6) sa.)
an +9 +5 Ne
+4S é
a 18 [8 0
AW) = c(44)* Aly)
pQgrz sy
4(3) = win feuun 4[5) - a9
COUCH Afe) = tB
CUS )EACTI AID
Afzjemin J ela) an (3) 5 ystes 22
OCU) + Ale) = 11 s1g22y
¢ (3) + Ala) 2 CHB=ee
AUT: wh $et24 40) > RH DOS 79
SOY) + ACY] = S4y 2g
a meet
eecememi e.