0% found this document useful (0 votes)
28 views25 pages

DAA-Module 2 (Part 1)

Uploaded by

Janhvi Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views25 pages

DAA-Module 2 (Part 1)

Uploaded by

Janhvi Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

,I

10 HoWlA

G,ene,<& m ethod , l3;na, ~ .&eo.-.ch, Rec,,. ,-Yen,e ec,i,u:, #ors


pn di1Jfck o.nol eo,,q ue•, fi\,t:l'"'g 1:)-,e /Y>O-~fm t< m (}.no/ ,-,vW murrt ·

/v1e"lr&,'1t ' l!)td'c\c -& oit .


T;i - 3 .11 3 · 3,
,,........__.__ ------
J , J-1

Tl -/+• / ,4 •J
~

SbaAS"er,~ 1'1")~ h,~-x l"Y'>l&h~rco.l->°on


~
Ach 1a"r ~ o..r:ol V fso.Jv o.nffi,(Ub d.Jvtcb. and.
cJJ.
C~u eJ, ·
J)ec l~= - __ ,
~- u.no u.eY A woch ; - a o Tj 3__
3· I 4-4---
T~\,--c-cJ --&01~ . 3 .3 J., 'd.
3· J.-< 5· .3
3 ,i

GieneYa9
X)Jv~c).;, O.rd CDr><::jvt"ElY 0h-o.c~ --SpJ:tlfcJ f'-, e I jp S i"nl-o
J.<. c/Jsfrncl: --8{)6se l:s ) ~le&l°a y, -&.hpn;b)em.1:, ; / < I< ~ n -

Subp)z)61entb ~ vlveol , Comb ~ne SV-hsoluh0ot1A fn l-o o

--80 \uBon °o the ~ )e .


II,,. the ,&,bp 'TfhJerw, cw ~ , H,en the clYv;d.e_

oncl Coi19uen .Sbc. L~ cM poSS~hl/J be lr e.a.; phd ·


often the /41).bp-vb'e = )'€M,&~"{) fr<,m G1. d,:vrd.,
Ono/ eonilAe-< "®~n OM cfb the .Som e ~" a,, th-e O'nfru.Q

? -rob\em .
l,U,1n 5 ,ecl).>s/ve ~-,m ,..n , Subp "1>ble.-M 0ml 30-,-,,,-mre,l,
t\,,al: o.-,e ,,i,n:JJ. f' ro~ h l:o be .80\veol 6<J~ tho,J: .<&p\~t !;''ij {l1I e p-.ociucec/.
f~ le ,. - .1) e~h ~ o,_ cou n f:ey ~.. t Q)~n

.&°c) Gc; th /I, Q:Jru, , one ,i lJ,e.M' Ccf n.. ~ .

he Cco.nle'f-jiv"t.
C
3 eYJU;1.ne On~ .

[Q.)) t. fs le d.d{ !'Sn? .fne wl->ethe"S" the bag Ccnl :ai" ~

Ccx.in~flQJt Co&, .
!J--.e tceJ 5}, q cg d _gel~ ~ CtJ
7("lb
~-re°J

let~ 8 ~ei...~hr ~~~ tro noJ l-o ~ ~denNRe~ th t'


pJ t
Ccx,..n'cr!-r Cofn ·
J3 I~ 15° It
J .J 3 ~ 5 6 ':'/- g 9 / t) Jt I J.
'----' \,.___ / \___. / \..__/ \..__ / '-._., ./ '---- "'
\.,_/

Aff ~ d/v t~ anc! CDr--qu(:?'> Yhe t~o/ o} o8J.

J>?v'ft:k_ 8,e O'n'°cr~ fn ..Jon ~ ~ntb ol o--s rnt)Y f' ,,&rn ail.t> ?

J)Jv ~ /6 C.Of n ~rza[DTY'f> 'in tv ~WO 8 Cdln '}i~.t a rye.J

CdnA /y>1 the -/f--rst in.6l-O.nC'P ( A ) a.rd

1JC~ the, /2eccrd ?rz-6tarxe ( B) .

the ~9 h~ °6 the .seb. fd .


C.Orrp-.~ Cc/in f) arx:I,

One w53hc Co ~so n ., OJnip1ele f:l-12 ~le . ~

dde-rrri.2w5 c\.-,e p-re'£rcE> ~ °' eounte-sp:; t: eo1n .

A
A B

1/ \ ~
8, 8~

8Jo.
3/ ~ 81 b
J.JgJ-l e-r .&t ~ o~ two C!J1~ , ;): ?s C\ --&rno.l( f,-,Aton('e ·
Ccntl't,\ obsh-od1cn (µ, < c/JvtJ; Ord W'Yj_ lJ <tn
• _ _,,/) Puncko11
l~r Dorc,1c( ~) PYtJh}!_)m J:o be .l/J\Vfkl.
i ,

1 .Srn:zO ( P) '> Plu"n S(p) ;


~
rtx, fs o. ~oJt?an vafu.u/ 1,/7 • t h,.1 d ~ m / ~
1. Wh?!h£>1 t he Ifp S:~ ts &-r,,Ji. e-nou~ h rnal !},e
Ci ru.we, Cb.r) J:.e ~ red ~ f lj-oul- ...3pft k cl
clc~rch p 5-n lv srnoJi.P> l'M l:o r~ P, ,f;; . . PJJ
I
J✓ 7 1'
- )

Aff4t) 7>:Jrdc to e.acJ, cg J:l-&.12 . -3vhprv->.,,.,,.I'., ,.1

Cornhfr-e ( :DonJ c ( p, ) , Z)ordc{ p?). ,, . ,J)(Jrd<( Pr._ )) ,


,,,
3 ½ fr • thaf del:ermfnf:h the Aolulfon l:o P
3 M.1 l:he .2olubciofV) J:o t he k - .-3~blerm ·

rt lnf, s:~ cz p ts n o.rJ.. lJ-,,e ~J.eA °o che I<

Svbprobeti1L> Glze n I n~ . . , nxJ I Comf vJfr:3 tfrne °o J)ond,C ~.5

cfhc'tli>e.} hd the --recu --ryence , ~.l-fon

5(n )
T(n) =-
T( n, ) t-T( n~)-1 . .T(0 ,,) 1 /tn) olJ)O"fw~ t='

7J,, ~ Co mple :;.J1- j 1J mad dJv:~ o nd r orv;1,f'•,,-

Cl~-O¥'t) ·~-nl) f~ 3n , b ~ )' €Cl n r err0:l tg th<' /µr< m•

T ( ,) n- I

a I b - /-< nown Con()tt:. nls

T ( 1) - /<.nown

n ?s °' p oWeh cg b ( h = 1:/< )


Meth, ~ -jµY ...8o,o?d recu.Y,er,c(? ,-d,o..kon ca. lled

Sob sb., tvlfo I') method .

He H,o cl , r~ h"u ~ ..& .J:t:,tf ['?.J.f>G,1/j f Y ea.cl, occ u. Y-Y<=rce

°tJ Che /y, · T ,n che r?~ ht haf"O{ ~ ,•ck unh l aJJ. AucA

0 Ccu· rre re& . d.ls oPF-7" ·

cJ;v~ 0. p )1)hlern i sr~ n fnro O s~ oZ hj b

ta)CPn~ j (h) b°n-1-f_ 1v clf'v ?cl..R_ o. rd OJ mti he

lt"me re9U1red fa -r d "vU ~


t~ p-rv bJf'r n f n i'V "31.A hp-rvbJe ,..,,

°/J ,Yow th ~ T ( f)J c/4.rnc/4 Ll.fOn the


0Yd€A
6
Co,v~co,/)J:s a 1 b ord o"c/b, ~ 'f1owch ·/ p,1.rc /:l on -j ( n) .
• I

Co ~rota;\ a ~) I b ~ ;9._ , A-Ssume n:;:: bk w h eroi. k == I r J' . .

T( h k) - 0 T( b~ ) + -j. ( hX )

::- 0 T ( 1:,J~-1) 1 j ( J}< )


S(,Lbst,d:·ul~ k. tea J<. - 1
:= a[ o.' (tJc - c?- ) .,_ J
i ( b/t -1) + 1(b ,l)
=- 0. ~ T ( 6 k - ,;)_ ) +- 0 t (b )( -I ) -}- ~ ( J){ )

Sabslntu~, T ( 6~ -1~

::: ()r) f o.T C b)(-2' ) t j (, b)c- J_ )Jr o.t { 1:}-1 ) rt ( bk)

:;: a3T[ bk-3) t crt l b)c-~) + a/ ( h)r-1) + -ft ( b1t )


- 0 )( T ( h )c -\c) + 0 )c- lf ( bl ) + 0. )1 - f:J i l be:? ) ➔ , , , + 0 ot (b )c)
~ o. 'i <n,) t-o•-'t(h) +o•-~tl h,;i )+-, .. + oop lh)')
~ W)-)tt€r-i M

- o."[ T/1) ,j- l


j =I
B~ p~~,.L\\ ~ Jo5~rn ,
).o~ ~~{J.
0 =- ,<.

4)-.,.,,l:~ ax le,':)

k A0:ibn Jl,o~ha.
a = o. == n
"rew-,,L-e l-J-,e equo..l·f'on
.
T(h) ::- O. k( T( 1) + z.k f-( bJ )
. )
j ~, oo

1,<jbO. [ ~9bn
.
-=- h T ( 1) + <z_ f(b~ )j
J•; / av

T(n): : OT(~ )+~( n)


a:: . :;; , b ;;_~ • T ( ,) ==- ::? , I cn ) == n.
T ( ri) = ;J. T ( "la)+ n
::: d { ~ T( l;JJ-i ) + n;dJ->- n
~ /~ T( h /J.1 J + ;} h
::- J, [ ;Fr ( n / e) ,J n / It J~, n;;?

:= 8T( h/8) ,J 3 n.

.,
/)_ ' ==- n
; ~ µ °J ~ :: J,o °'J:/ '
;,;i

; :: /4 ~ r)
';}_
T( n ) - d /4 'l,,_n T ( n
;/''tin)
';;:, h T( I ) -t r;JJJ0~0

::: hjog;;_ n +J)n.

AnSW&) L7J !:he hew ,,8t,( hp"1Jb1em f.s a,bo f-hf> c;.ru,l,V0">

/:v the O-r'!'ifra}. y,-,,ble n-, p, L'heYe ?s. ho n-etul P<'"' °'" d co,.,-,bfn-"'"JJ-

z
,nc hw:::.I I j,/gh= n >-

tvhf Je ( ht)) < = hlg h)


i
i'n t n1/d:: C /4w + )v'9 h ) /.J ~
l( ( :x '- a [ n-i/dJ)
hi S h ::: r n)'d - I ;

f:k.e f { Jc :;, a[ mf d])

/4 w ::- mi d ,-/ I J r

~ f 'r~h,Yn (mid) ")

) Yett.J-Yn (o ) ; j
inl b.•~ ,geb-rrh ( o[J I
l) ) , x.)
t
f( }~ == i)
~
1 c .x ;: ::: a[,·] ) reL~-rr, r ~
e.-t.:.e r-el'"LA.-...n o·)
)
eJ;;e
~
inc rntd : li+;)/8 ~

1 ()(:: == a ( rn,•c()) Yecv. -r n rn/d ~

eke 1 ( ~ ~ o ( mid]
"rel'1)..-rn b t~,t,eo--rCh ( a I ,c I mJd - I ).)();
~e rel:o.."("~ b?n~/4.ea-ic h { a , d"'r'llol +, , ) )>c) ~

f ?<°'°'J'Je:- C() n sf c/4,n I J.i e,&r-nen~

-15 ....;6 () f 9 J3 S J.i g~ /01 I Jtl las 13 ) J~J. JS I


:) 3 I.. s 6 ::J 8 q lo Ii I i}.. 13 I Iv

:x .:c 151 ;J ::=- - JJ, )( :: 9

ii;w JJ5h · m1J /4 w J,1'3 h r>-rt"e,(


louJ hi') h rru•c/
I }4 1 I Ji-, "f I ) 1,
g- ".J
I J, 11
I 6 3 l 6 3
IJ. ( )-j 13
,~ )4 I Li
f1
I
c9
J I
cl
;_, 6 s
/0t.1ric/
f und 1
d.kw Ps o/1.Q<).l~
ch10. 0 h:~h
ho l -/,Jllry,{
To Clna.~~ o.,~ f"}( ect,,<tftJn f'rV /}If! ~ 8,"~,8ecv-, cl-t ,
J 't~van~ cho 'tO. c-l.B1isti"l-l ffl.Ui u. er-~ co <.An l- O nd ~pau re 9 u,.' yeo/

~ Y li-ie ~~l'hm ·

S!~o~ ts rec;~•y~ fov n el.trnentS °o ch<=' ~


p) t<-6 l-\.,e vCvtJ ~1t' /4 w , )-,Jg 'h , rYZA· J o,,,..J,. -'C • 6 o n 1 H. /4 ,o..1-,~ 01"0 •

J
As !~ '( l-frn-e 3 f05 Sfoi ; n ~
I ) )_.- bnA
=.,
t" , t,_ Vet,~
(f
1 t,._}()"fSl- •

8t ~ ...Bea., ch I:hat mo.){V) o ~ one OJ mpa'"' :so r, pe,r, f' )_e--,o-h"0n

~ the e,vli:)f fetJf ·

B,•~.s~ rcl-1 ( o L ] , n, .)t)


2
inl: hw=I , .h15h.:::n+1 ·
,I

wh:Je ( /4w < ( hlg,J-, _,))


~
;n c rnld =- ( Aw +A., 9 h) / d. ; 0

f (x < a(m/JJ)
AJ'3 h ,= rn..td ,I·

:X >: a[rn.Jd]
~

1' ( -X;;; a[fewJ)


eke rel:u u , CO ) ,
)

J
:~......~ , '~~~"'
,....,'"'\', .' ,,')'<~ ' n~, ;!(,,}, Jr, J,._, \(,,) ,),\' (" ·\ (''>< ' \('n) in

r, /)·- '
[I V-,t>') to t~c'

\ Tim t> ".:C,t1:)<2 d Lv ('() •Yt-t>. .,~ lJ1(?

nut{:/LA tl~rn~nl. .

T ( n) = J+ ,( n{~ )

-=- I +- J J. r( <✓J )
- ~,+ T( t~~)
~ 3 +T ( h~3
c:x
)

t1 .: : n
; .,. As :2 =./49'9-n
~

( ;: ic ."l.n
0
' bn +I
T(n) -- .Ll'_:
cs
f"nd t>ie rna-tim~rn CArd m tnf m u. rn

n e,&ments ·

Vo,•cJ ~ -xmln ( o[ J , n ,&((')Cl?c: ,&,Yr/n)

i
ma-x = rrt.Jn = o[ ,J ~
fO"i {_ fnc i:::: tJ ~ i <. =n j i++)
f
1 {_ o [ ;) ;::,rna-x ) rnci -x::: a [;J;
i l a [ ;J t.. J rY1,:n mtn ::- a [() ~

)3
Exa7 le :r q
f, ';}- g-
I ,1. 3 J..i ~

5o -5 -9 ~~ 9o 6£ ,R~ 1~
~()

t
rnln
ma,c

r,-zJn -:.. -9
f'>"¼ t :: 5 0
rnln:;.. - Cf
('n(i.. -j..:; 50

m~n::: -9
rno. :.X = qt>
~
, mfn =--9
rno..:x = q o

,! AO
,, nuncun

::: _ 9
f '
So
1 c,•=c;J) 8,
n-,a ,;,<. ::: (Yt.J°n := a [,' J ; So ho

efoe i' ( ,' = =} - I) .Set St? f:C,<.Jo

t
f { oC;J < q£jJ)
t
tn(}. 'Y> ~ 0 tJ J ;
m/n ;- a t. :J ~
~
ehe
r
min :: a !JJ ~
J )

1"1-7v1 1 rr7J n ( i' 1 rn,/ol , n,cJo ':t , rn,,~ n);


J ne{)J ..&~hle~
~ gene-ro.ted. [
rno.~JYt f n ( rr-z.l cA ...J I ) J ' m~-x I, rn./n I)
./
,

Whf>rl the l'T'lOa ~mo.. 1l r>1 I}. -j <:: m~ ,< ' ) rri t>. )( :: rnC1 :x /;

aro{ mJ,u"~ ~ /J.,e,e 1 (r,v n / min I) rn..,.<>n :: tyZ,Jn J ,


/

-&i}y,vh1erM at1.e j
~~ I two /ha?(f(T\j

On.Q. etxnp-red o.rd l:wo


t)·ilnfrnQ 0.-re c..omp,-'Ye.d h> a..cJ.11evp /:he )SO /(;(h°on f-v th-e pn/1-re ~et.
) j_ 5 1., 1 e q
dJ 13 J5 60 }1 ..31 4f

u •
' 'J , rn()..:f 1 (YIJ."n

G)
r---
JI~ 6D, - B
@
:).J, - 8
J,5 60 ,l'J

(!)
~
~-8
-~
60, Jr::/ 4':f,3/

J, J
clJ, 13 --5 , -5

0 - r1raien t the Ortie•S in C,J/,,fc I, rn,v a rd m f r> CV!.,

~~n~ VoJµ€h .

1( n/8 )-rT{_ '1/;;_ )-t-~


T( n) :.
}

()

n is C<. fO!Peh CZ a' h ;o ol.


)'-
Ir' ,,Some p :kve /nl~ fe.

T ( n ) ;:; d T { "'/J- ) + ;)_

~ d [ J T ( YJ1J,) +J J J
:: . ~ricrii~)-+~1-;)
0
I., r~ r( h/o' )-i J JM -1 ~
:: ~T ( n;g) + 8 +~ ~ J
8 /' ( '1 ) I ii I J' 1 ,)

~ I,I I It
,, ,,
), I I· I f
1 ( n)
,;; 1(/J) , , ,)
I
I I
,')

1
' :J' 1,?' ;i ~ !
-~
'
It .-80,l:s a Jn · an-""c\ bg cl'v::,l"cJ ~l inl:o l:wo
h a.O v€1> , ..& o,1-,•'J eo. <h ~ !:he rn Ye <'UYsr v~ Cl,.,,( IJ,f' n

h->eyfnd U,f' hua J3maJ}p_, ,&o,1-ed a-,y"? /,-,/:o Cl )l Ynzle


..801ceol one ·
A [o ___ _n - ~ A[ o. r~J
A[ LhJ.JJ . .. , hlQ

Al~-.? dhm rne'r?Sorc ( ~, /4Jw 1hi"8h)

1(( h w 7 lv"gh) yetrAYn .


1 n71
mJcl ~ ( Aiw +- }v"~h) j:)
Ulf ~ A[ o- L '7/2,j - LJ 1-v
fne"Tr Sor C ( q , fe ()) , m/J ) !3 [o-L n;z.J -,J
nw,r~O")' t ( a\{Ylfc) + I ' lv'g h) C-ep<j fJ [ L'Yi.J --n-,J Iv

~"~leme-o-r {_ a ,J-Ow, wt.lo/i~l 'jh)


C [o ... r nJ2l ~ iJ
rn~&fl-{f!:. [6-..L '½J -W
fY1~50.,.t ( C [o.. {72 1 -il)
~ ( fJ , C ,F})

.
{~J~
.,
}L/:::-0
1/p
( B [ () -- f -,] , c- [
~1,,
0 ·· t -,J
u) t,} le C r l. f"'r) Cl rJ j (..n ) fl [ D- --f,-J- q_ - ,J)
01;:,
1( A[:] ( g [JJ) ~ en 1 Cfl [,'J ~ CT 0J
C[l(\ b A(rj
/ i::- 'f + l
k f- I<+ l
C' [ 11J ~ B[j]
j ~j+I
)l.~ ){ +I

ftvA 1
enA wk) f
CA.)k.' lf ,( f ~ rn) £ t#,e"' '/ O'f j ex~ rb- )/~1/ 4 th-e.
(' [ \{ J '=- A l ,• J e&menl--.s 're,-r~.Pnl~ 1n o[ki'l' \/~torr C'tlh '=,e
., "
1t::-1.f-l
C/Jfed 1n ro the Ve.cm c .
k~ k-t J
~no{ ~ }f
WhJ)f (j er, )
c[1c Jr.- g L'j]
j~J-fJ
I< & l<+ I
E'ncA wt I e

A) 'r"Jl,.,,-, mer~ l A , hw , rn,' d , k Sh)


/ I::- J.ow
j ~ m1J+ 1
k~ /4w
4JJ,:; !e ( : '- -= m/ol o. rd. j ~ =c hf <3 'h)

1 ( ~ [iJ t._ A CjJ) d-h~"


c[,c]&- A(r]
f" t- 1+ )
}(. &- )<+I

ek.f:
C[ )tJ ~ A[jJ
j ~ j+ I ·,
k&-.k+I ;
~l,;Je (; t_~rh/J)
C[><J c- A [ iJ
kc Ki)
i '=-- i+t
eno{ G4. l.; I€

wlJe cj L ~ hf5h )
C [ It ) e A[j]
k c- K-¾- 1
j ~ j-t I
end wl.:.le
/;,c~ , = .Aw lo J.J5h
A[:] ~ c[:]
5,c) ifCY

0 1 ~

n -==- 1
T(n ) =

\ T.~me r eq u.'-reol. l-o di v-:o4. o.r,c{


Serl: )15htpanr
,.......
,,c:,,,_,J2 Onf! ., L
,rv.icz.,v C ci. ,8olu~ on
y'-O O'J
~ H,e tu'l.J lo~ Jh n -e/4.rn ~rk ·
(.aaY)

T( n ') ::: cJ. T ( r,I;;_ ) + n


No, ~
p~..,.rrtUJ.
rn ~ sc~
~YI,
}~ UJ~S o,-... .,
~

o ;) [ J T( ; ~) -!- o/J +rl /21,- <?Act--, -<lc<j' ' '=1,:s,:/:1 'J


0~ ~ ~ OS()'"' -· ~ ~ I

;: J ~T ( ...2__ , + n+ n 1):e- wt..:° ' Ji..e.. fu M N-Vn~


d- i ) cl/J ~ ,,.,!;- ,'n ~ NJo
': J~T( f>J) +~n ~ sh"(l ~ ft) h e_
u- PYVc e>..Sec-\ .,~ ~ t2

:: d:)_ [8, L ~ ) -+ _!2_\ -+ ~ n.


J~ c:z:;i·J

J.-e t d- ' .= n
T ( 1) :: 0

= n., ..(n ) -+nt .


I -
r,

- n,.
~


J' = r1
,o A5 ~ == A9 n
eJ.- ~

, :: };5'),n

As:;,~
r ;: - /4s 0 ~

T(,v -=- n;
~ >1 fe5 r)
~

'
8 3 q

9 3 4

3 4

' I

I' J 3 e3
1_ ~- c,)-4 1
A CtOycl-u h, p..,-evfC,l,l6 ~ri!hm , ,oJ:- f ~ not-- ....8
=-ta-,:::;;.hle .

A Sork'c) ~,,Ji,,.,- -, i.s Sa,'l;l 1-o be -8hh1<' ,f Mo


W7Ch ~l4ol J~ ~pecu-, 7n r\..e ..w.rnt> 6-r~ ;h

Ou.I-put- ~ th, o-p~ ,n ch-e I}p un~o1L-e& ()Ju.°tf ·


Some ,,8oth°r. ~n~m ~ .,,,gco.ble b(J no...6->r(?
0
tn.Se--kon -&o-t f , n,eya,e- .A o·d:- , bubh1e --801t ·

ADme .-&o•h·no ~-;;Jl,m ,,; an, /-W~ _


);k-e J..ec.p So-rl,

Aa 8n. ,80-Yh"o ~~ahrY ) lJh,"C.h fs hot ,,Sw.ble

cal"\ b€ rnool/ Re,oi to h-e --&to.bl-e .

In 9en~oJ , ad Ca~"s or) b Q/)ed ,,g0'61fd

~ai-m GJh/ Ch rs 11,ol: .-Bto.h),e b~ r;o-cv-Ye Can if mcd/fw

h, be ~ tcd:,I e ·
Tfu .-&l:o.rc((). v d me..-trort on an £A/l/li rs not- o. ri
1
"plo.c,_ ~"1d iirn , -8Ince 1~ '"'7 u.. "y ~ D( N ) ackJ.,"/,onaJ. 3f'C>.a t'lJ
P~1hJ'1 h"I the mer? .

luf,lch dJv? ~ its


t'h€ir pos.rl-,on rn the ~ I

dtvrcb,, thE>rn =co.,.ol,<,-,d fv thetY v~ ·

'< Jmw :, h.'5 h , L1,e-,,, a,,. tw e&menl., p~e,,e,-,/:

"' dJvfcM. ~ ?nro c2. p~~ e&rnenb L'TJwa/4 1~ 1;


j
J~

ek.rne(\r Qf1e As tho.n }~ e&rne nl;i Oriol. e&rn en~ L--rJuJO..Yc&j

r,"5ht °lJ )~ ekm en~ CV1e ~~ I'hC,\Vl I~ -e&rnQnl:- ..

k ~ p~/:ik{Y) C: ~ , Jotv, ~"9 ~)


'oe~'l n the_ pos.rko" i I~ ~mfln 'I:-- ,

~ ) ep-,M}_- (J ~ Q ~or~4- ) ,,.,__n


(f UA
Pndex .lJJLu tu J<-/ .

So~/:- Ap- pOA/.- ,ec-(}.Yrfv~ .


,, ~ 'rl13hC p a,,} 1J CIJv'fu-j o. ,,,sh:v,b /mm !ndPf. !<➔ I fa J.,:5h · J. (!JI

So)~ °n'Shl po-~l- 'ret(}.r sr ve,,~ .


• M tel )lo) k~ , /:he pas I I-ton ';3 )~ efunen/- w.' II n I:°
Cha"'Y o.rol the e..-- l:fre ().M"c) f s )lo, teo/ · /h..£(1Q rs M n-ed

-16 meY6'oJ .

.AIW>Yith~ {9t,u"clt~ort ( a, »Jw1 J-il3h)


f ( hw 7 hA"S h) yef:u-Yn

k e- pa"l-5 l5on ( a , Aw(h/9h )


J w"c)c --8ort C ci 1
/2 u.; , k - 1)
/J.lllc\c _,,,g o"(l:- ( ~ l k-+ 1 < h.t9).)

To c/Jvrck the ufll'aLj 1

O,.,b~(.u-,, -e \J ~ ~ Vo.ffeP. ~ )s hJ 'Y-ed al th-e eno/.

1J lht> ~ -

Proceo/.v.Y<2 l:o po:iBk-on tht> ~ ,

)~ f0 cYerY1-e~k115 ,r , ~ P ~ A)n~ ~ )¼j


0
2- a [ ;J
Jo : & 1+ \

Wkle l k~ ~a[;J)
jxls , l'u2!Zf c/4c re rn mkw3 rrt/4;. j cu .Jo"'l wi

~< -~[jJ
Jo j~J - 1
w h. Je ( l<~ < a [ J1)
f XC' ho.,,'}( Ci. LAiwJ wm,.. «£j J o, rd f riaJ. v~

°lJ j ~-> veti th~ ,PO~f;,or) ~ ch,e p :vot OY / ~ e/.w-ien~ ·

A)~itJhm prxrM-on ( a, JtJw h)'~ ~) I

I~ r::::- o_[ h(µJ


r° ~low
j ~ kA"~h +/
wkle (tc=j)
do ! <-:- /+ 1 wkle ( !~ ~ of:J)
d-0 j ~ J. -, wkle ( J<.W-j <:: C< [JJ)
f (;(J ) f)?(C'ho ~ ( Q (; j , c.:['_ JJ)
end w0Je
e1rha"? ( a [ hw ] l al j J)

f x.o._ry}~ ~ 0
dJ. 3 J., ::;
~ 6
5 3 9 g d. 4 1-

~ d
.
{

l

C •
(,

j
~j
Swo..-p
5 3 ~ 8- ()_ 0 1-
.
( J
.
;._ (!.i
-..J
8 J q
. .
I
J

l
f.
d
~
5'JJ°f
5 d. 8
.
I
J
(

d
£--(c~'if a [ Jew_) u.;Jn ~[j]
.....
3 9 T

.So1t ~pa.~
0 I .2. 3
d- 3 }-f
' =-c , P'sj-, ;:c 1
~'-'-
p-1.'!{
• k =- li
(
. J
l
.
. d I
.t....01.JJ -::.o /.Ji'5k3

~o
Sw°f
k~ 1

J 3
£
.
J
L
Ll
f~ c ~ { ~[Jote) t-[jJ)

@ 3 ~

3
f>;•c t .
("
I
J
l
j
J f-<c~(\y a ~1.c~J 1..ck-. o (i J, ~ f.s M c_ ~'o/
fxary le:- 1
0 o1 3 "1 S" 6 ..,
I q g 5 5 t 6
p,•vDt
.
• d
l

(
. . •
{
. ' d
. J J J
J d J
~'1' ( a £Ai o>J , ~ [J ) )

~ q
CD 5 5

q 9 5 5 6
Prvot- •
("
J

(
~

(
(
. • . •
I { t
I

<)
6jc ~~ (c.[Aw) , o. Q))
6 CJ 5 s 6 (j)

~w ==o ,J..Jc)•,~ 1
)< ,:, I

~ J.ri/./) :C J / hJgJ., :=> 1


k :, 1

hJw;; &>) /s h4
/ \ k "' r:/, hi,;J, = ':f
)~ = ~

/ ""
/ ~
I &atck,.go'1t ~YX1hm rt nt.J t" .-Ero.ble .

I
I
1Qu1c1,go,t ~~Ji., ,,, :s tnf lo.ce, J!P> /- Sw0f!17} ~,,l ,
lvftJ,;n H,e .I/p ~ S htArttAr~ .
• WW I ◄ ~
,i (I JJ

4n.1.Qd~ts
~t)l ~E> , e<:ct~S if )<o~ e~E\"l ~.s p,e'>t!ril exM•U~ al lJ,e

C'Enhe cl'v~~ lhf'> an~ ,nto c). ~qt.1t:\..Q ports

T(n) ::: f n-:, I

T( n/,9. )+ T (n/~) +n
\ to po-r~l-:on h ~nts

T(n)-= d.T ( nfa. )+-n

" .;1 [ ,n l '%i•) -i- %-} ,_


= dl «'T ( _!2_}
,JI)_
+~n


I
J=n

~ n;

Tb;f,~ /4 hodh s~cl.u.,


0o ri

/ h5 J ~ /45 n
cJ ~

,. ;:: /4 tlt
-r{n) .,, n /4q n
;)

IC, Tl n) :: JL. ( n /4~,J.1

You might also like