Agsignment Noi $—————__—
1). plain the tower 0} _Hanei
_Solwsiga ine py statin
TTower 0.) _Haani- _—
Tower 0.4 Hanoi is 0 matnernttical puzzle Wher)
thes hve toda_Gind noo} disc a
Oo
iN
4 the puzzle is +0 move the endive Stuck +
0 dentino-Hom dds by _Obeying =the following .
Simple xule-
2) Eth move Consists 04 4ulcing upber diac fram —}
pe 0} -the Stack fad f4 on typ 04 9
the _ansthey Stack, tre the disc Con_be mov! {
jy ta_is the Uppermait dise C4 the Static.
1)_Only One “dise__(an he moved ot _¢ Hime -
_ 3) NO “disc_Shali_be plored on _ “top 04 Smalley ise
ase aeVoc anny
de) “Ton On, so!
\yone\! a
Print CE Vove dink \ fron: "8" to vod". d)
Tehui ny -
(Orn tnt, sedan) ——s
avin 1" Move dis tes Wa "4}4onn vod": ¢,,"40 vedi) S
TOW Ane $id)
Ne (ny Unpod U"Fnden no. of disk")) —_—_
TON Ug Sy wd cas") —
y, Ute yon brogs orn Yo Implement Merge Sort
Atgow When Discuss how we Con tompaore the
| time Com levity 0-| 4wWO_Algorithrn »
| Mgortthey O} tnerge Sox ve
Merge Sort is O. _pividh Gnd Conquer _Ci\gorithm.,
q
| ——
+The Mee) gunetion. is Used for merging two
Walven + remene
THe merge Corr, 1.299) 18 Keys foyocess ttt Gssuma,
(
| anor Coy Cle smd and cvitmtt--¥ I Ge Sorted _
| Gnd merges Ane sftp. Sorted Sub Gays into Ghee,de} merge Lary, Lat Die
23 que ee
| Wr Y¥-m
L= Tort) esienl ae 3
R= Coit tr) 1 3 er
hori in elo, ni)! -
Urit= oT sit
=i} in Tange (6, n2)"
Rryy= Gv (mt yas
r i= 0
f ye 6
x | ‘ Re)
F White idm Ond 4 n2\
. ig tide Voi
. ayiCk1< (ei) a
- site
, kre l
ic while dén2 a
Grtele RII —7—
ea cet i
q wre \Merge sort tary, Lim)
—Merge Sort Cpyy, mat, yy
Merge Oe) wd) $092. foes
Co il Ca bral em
—ne= len Lory)
Sprint {" Gaiven _Crvyty is")
1 yoy i tn Tonge (ny.
| ovine treed", ve Gyrtig, ends")
mergesort (avy, 6,n-1)
| prind (896 Sorted tvay, 38)
fo tin Yonge tn)
print yd", Ye Caria pends" ")
| AVIem et eee
Aovied _Ovroy is
am eren\ ena
“Time (oentpley iy:
ad Ont Logind)nur tnd bina Sete
The me Cona)plevisy 0} linenk “Senrih Otn) .
+ Mulilimensional ore Con he ‘used a E
By
+ Ja_is tess (ombpiex-
Binary Sepa « 4
A . ea F z=
in steve) Ovdes- =
Fee Gite _Colted hot = indeng) Searls >+
+The sme Complerity O4 binary searth 6 \ogn
od only Single dimensional Gray is Used. a
Sesh po iy pin —
a px.0 grim for Rieve 04 Fructo sthenes- x |
2 Sorting i€ ss : /{merge S00:
Merge Sorts geyined 0.5 —S- Lording Mle erise.
“Ann poor ks by, _giuiding Gn —crrxay ins.
__.s | Smmatlex Sub OTToys—+- Sorting fla Sukorray et
__|L ond __then_ menging, tne farted Subarengs Nath oh
__tctngethey 16 eum dine =fingl Sore — oxmup _ ey
eon Sust_ th simple“ ond ees —
Sorting Algorithm -thoa_Works by epectealy ———
“the Smallend e@lemen+ -|yomn the ————
=
=geoaping tite! alemens
jayssedi te crete $6,320.54
ped Eis Pass
r
7 aa
\
nee
\
— mee
[oT a tsteq
Progrom 94 Sie 5White P* Pc: y
se ps iy Plen. a —
oo nai Lin “range | Corp ann, 2) yt __
fee imc Ci\ant —
Be ae alee fe —
a1 pint" Palme notice
pee ———=for Lin Tange Clen (evi mer)
‘ jobrime CULL 2
= —prinil" Prime ra", nds aes
3) s Yi. ; ; ;
_ write 0 _prog%om for recursive fihonacer
Senebiete a ‘
Ang: | JAerotor: t sis
epee
FAexotox in programming —is _d__frrocess here in
(a Set of tnctrustinn Or Swietunes _qre epedtedly »
| Reuission:
Rewmian— they ent eeF
Proper ‘ Rewraion ___J-lerotion- F
Fibs daigion _. Funetiun atts Set 0} instructions
q ____lisely" + _vepeo-tediy exetuted. §
i at aS ti, Ae L
Poennai bs Gy _unesions i: for lope. _&
Code dee ~Smalier Code size’ es lds Site
__“Time Combe — Nien yg “Hilpa o. _ Relttively low@ | —
cake. é “fins as oa. “imes famplexity t
[tampierity, recs ee Spare rma t—
Complexity is —
3 higher thon. pil! -—
{4 evo-tlon Betis d ant =
R sion wten TH eyption Weg __-=———
__moire_Ahemory as _Less_ memory as ——
2 | Compared -to___Compored_to
{eration a union.
a
Dwehghd—___otseases Ovando ca -—
10} repented -tunetion _-there_ tise no -——
* Colle: * ‘ junttian Calo. _
in _Lerdtton
ee
——— :_Libonacci Sequence ualng—Yetwynion:
dey dew Jib Ot’ eee
Lyon