0% found this document useful (0 votes)
6 views

20191cse008

The document discusses algorithms, defining them as sequences for solving problems with specific properties such as input and output requirements. It covers concepts like time and space complexity, pseudo code, and various algorithms for tasks like finding the GCD and prime factors. Additionally, it touches on recursive functions and their efficiency in algorithm design.

Uploaded by

pedesis490
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

20191cse008

The document discusses algorithms, defining them as sequences for solving problems with specific properties such as input and output requirements. It covers concepts like time and space complexity, pseudo code, and various algorithms for tasks like finding the GCD and prime factors. Additionally, it touches on recursive functions and their efficiency in algorithm design.

Uploaded by

pedesis490
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

O

2o19lcséoo&a BRaikunrah
ASsignmont; ol

what is an algohithm ?
of wnam biguauk insthudig
an algouthm
a n algomthm is a Seauence
eavied
a
40 Solvinq a PYoblem, i.e foY olainir9
Oud pul foY any leqitimade inpud in a finide arount o
Hime.
fx Plain tha thm wih an exam Pie?
plopeyles af an
algovi
PYoPevilies of algohi-thm
Inpu: 9hould accept 0 o nole inputs
oul Put: 9tould pladuce a least one out pu
9hould tasnAfo1m he
esfect IveneNs: evelu instlution

8iVen T/p Ho desikd outPut


Hitnen/Teimi ration algorithm 8told deYmirale oley
finite ro.04 slepb.
be cled and
clean
each Tnslluution ehould
-DefiniHeneAA
unambiguOUh
1 ndefendent: gonthP can be expressed
.Larquge
in any larguoqe
must be 9imPle and geneyic
fa Sab le:The agonithm ho
uPon with
be execuled
Sch Hat 14 Can
available Yesaiye.

ey 8/ush youy Tee th


Inpul BIush, Paste weley
Heeh
oudPut e lean
2019LcsECOdO
feeh biush
a felch foste
Rinse byush wih waleY
4 Pud Pasle on brush
S) pul biLsh in rout
BIUsh youY 1e th
| Rinse&SPit
bedween dlgo1 thms and euedo acde wth an e Xasnfle ?
Tnush
is a sBep by $tep PYocedu Ye
lgoi thm- an algotithm
Ho Solve a given Plo bem
Pobem
govihm a prodlye solvirg a
PSuedo code
P.PseudoCode is amelod of wviHiq algovithm
an

|8)a paide code is a rotod el developirq an algovithm


eAdd two nunm beYs.
Algo1
M ithm
|1S1dt
andb
d8Read Values of a

9 ComPoul a b and stote esud inum


4.Pyind value of Sum

S.stop
PSe Udo code
8P gin
indpud a, b
9um-atb
PYind Sum
END
A019lcs¬00Ra

Deyine 4ime com plexity and SPace com Pleridy


UY1He an algovithm for addirq naluyl num bels
find tha sface Yeawived by tho algorithm.
ime comPlexity: Time com Plexity isa furlion descYi bio
time 0n algovithm dakes.
h anoud o
comPleridy is a funt ion desCYibim
ComPle Tty: sPace Hakes
1akes
thaaount of menoly an lgovithm
numbe 1 :
algotith mfO addlilay n mlual
inpul n num bevs
oulput unm of n ralulad numbe %.

1-Read tha Values of n

a. i 1,Sum-0
.foY i1 is -n
Sum:Sun+
S pispiay sum
6 The Space completiHy 0l algo1ithm is on)

wal du th diffeerd mathardlical notad ions used fol algolithm


aral y9ih.
asmAric otad10NA
.

O-They ae mainly h Yee


8igo roladions
onneq o rolal on s
thela rotaBions
190 Nota10Db 1 YePiexnds th uPPe bound ot the Yunni re
Hime of an olgolithm.Thus il giveA thewYosl case
Complexrty of an olgoyithm
omega Noa ioD) omego Ye pvesendh thu owe y bouwnd c
Hhe Yunnirq Aime of algov ihm, Thus il gieh the beht
Case com plexidy of an algo11th m.
A019 CS.CaoRo
Thul
NglaliopA Tl closes ht fund ion iom above and blow
en
Since
nce il Yeprennt he upe1 and towey bowld 0 hi Yunur
ime of an algovith
ithm.Ta is Used analysirg h aveloqe C0Se
Complerit of an alg ovlithm.
algoithm
List ou
the steph ttal naed Ho design an
much
PYOblem:This slep
1s
3n1) obain
e ) oblain a descY iption of
OYe di fAicl thun id appeaUS
AmL uge-the PYoblem
) De velop high- level PHOglam
e acdirg moye
delail
)Re fine tht algovithm by
3) Review tha algolithm. and omepa
Notatian.
DiAR lendiote belueen 8igon
Biqan Armeo.a
i s ikek yale of gyawth 974 is tike zz Yale o! 8 Yowth
0falgotrthm is ehb Han oleaua is gealer fon or eaual Ao a specified
10 a specific Value VaUue.

a8i9-on(o)- wosl case


)Biq omeqa(n) 8est Ca 9e
3 Bi9-0 is a measuYe Of0s) Biq ig
ime Aak e a small
lorqest anound of
anrOunt of Hime
&EYPlain ow many algotithms Can jou wyi te foY
al 4wo numbe,A. com pdu which
SOIV irq ind gcp
is ro st esfician
9019 SCoo8o
meod 1: midd le- sclol mn
'npul1wonumbeYA M, pYime fatoYs,
thl co mron
o4 au
OutpatPOduct m
fauloY3at ion of
find the Prime
10n 04 n
find he PYime fatdov gat
tht Common Pvimefailol b. fabol
PYime fatio I b and veluvn
Sind au
Produt of au the common
4Compute ta
a b gcd (m,n)
mehodfucidh Algoithm
b
RuTw0 integeia a and
The andb
outPul ged of a

fabhon
vek urn a

e 1se tf a7b thun


Yeturn gcd (a-bib)
else
velum ged(la,b-a)
end. b
odrod 3 consgcalive indegev cheukirq
n
Tnpu:.Tuwo numket m and
n
Thl Jcd of m and
odput
tot
1.a99ign value ofm.n fm,n?
9 Divide mby1
Yeroinde Y i So, 90 HostepA

Othalwise 8oto gtep y


3 Pivide n by
t and slop
fvemain deY iS 0, teturn
0theYwise. 8o 1o sHepy
bectease byn ond goH0 step
Anong hes e hYee metro d ho etic ienk on e Rtuaid dleAv
Dife 1er e
e 1eniaB beBueen best wst and a Verge case efficiady
P lwaya AyeYaqe
D uoYst case amlysis PTn avelode Case arolygis n bestcase arolysi b,
| Calc ulat e to
|0 a exeul ionuPreV
lim Hake au pOSsible inPt
ho We cauculal e Ho loweV b
ime nd cat culal e
Cicution ime
ime for aud of fht
an govithm Com Audat
in put s.
icn
p an algolithnm,
Pîn ingo satath th
TOSt Case apeavh hun 8)uwe nced to pedict he )hi- ro-0! apPeaiion
eLmont of found.ThoPloc dSY ibution of ca
seb in h best case in
99ach ConMandThi time
fhu time co mple r foY ha tinco
ofoALn
PYO blem a5Sume tol all
a5Sume tal au Com pleity weuld
DYOSt case is oln) Caseb aYe wd {onally be ol).
i stribute someadd al
hiasPNand diSMCAian-
rolations and HA Plopelly
DiegiggcuA the Concept oj asum pBotic
an algovithm
isa tol to evalwate ptfoimance of
meave ment
cYitevio ave
The
Time
9Pace an algovithm in tetmA of inputA
SI7e
ue evalude tha pelfolnance of
dont thi actual yunnirg 4ime
We measyYe
inc?0)RA
we calculale, nowdoes the time takun by an elgoY11m
wih he inpul siae
ion time ig gcod idea, but
it is delend on Co
compulalion
mpulation
execud
POweY of ha rathin he algolHhm 1s execukigon

|.6 Pace veav itemont IS also depends on he addesdire


Schamein yse t.e 3abt DY bu bit Syhtem.
&01S(SoaRo
Discuk tha genaval plan foY aolRirg efficency o
99RecuYsive algaithm exPlain indelailh uGin 3eution edt.
ron numeVic

is a funtion which calb iHelf oqainord


eCursiyefuntlion
ogain
hi Huo Hunt ion excepl fov
big diffevenes blw
1hase aatl y not an -tuptd ionA to Call, 1sel Usuay
abi llty od Neeu Ysj ve
T
|10 Yeduce loo ps.
ploduels ol subYocetimeb imPlemartt
Plesmarior
lons
lODS
ale im
KecuYsive funtd ionA
Whose
1aguages.
imAemerd ed n a pgVam
does rot Yefelenceb t6elf. an erlelmely
in genlYal ha
A Yecuvgive -furlion yecuysiYe ane dada ro
uhile a ron ab
as o
onn
com pet w hhere
de w ere
h 9hdime kas
sauy
Code
o
geneYally
fwntdion
A Yecus
Yecugive
one is laYgeV ntdions Can
funttion s can Pelfovm
Pelfom
Vecu Yeive ecuYgive
a
Yecuvsive

Onlya bo th
situation siHuatlonA

Tn Som oheY Con do i.


task
bul in iVe can
do 1.
SPeuific
ron vecuYs
funtd ion and a locatlon
0
mIN
o
sel
Algovito emerd in the lis
minium
Spah ho MIN
tocation
toith values
a nert
Plument

uap Poind Ho
Pnclement
MIN 1o
is Sy led.
Reeal
edil is ff(ntiJeAlimin)
ReSiet ion son LA n] iminÍ

foY i 0 Ho n-2 tempAi


ACi1eAimin]o-(0-1)

Imin Ci - (n-1) limed A Limin]-lemp

4oV i-i+) don-1


Salglc3coo&a
explain h Ctuclid algoithm to compulirg GCD.
Apb tuclidh Algovi thom
TnpulTwo numbey m andn
mancd
n
heale Ys Common divisoY o
OutPul
i m-n thon
Vel uyn m
else if a>b thon
letuvn gcd (a-bb)
eise
Vel uvn gcod fa, b-a)
end.
fo Computire
exPlain thi Con seculive indege Y chukinq algovi thmA

3De Consecuive indegel checkirq Algovithm


DPuLTw0 numbeVm andn
adpul Two gcd of mandn
the value ofm in (m,n3 to t
a99ign
9.Divide mby
1 heverande Y is 0, go 10 slep3

|Otherwise golo siep


pivide n by t
3. Veluvn 1 and slo
1Yemainele Y is 0,
othav wis e, go to Slep

DecYease by and go to slep .


2a19lcsomRo sedlh 5ohdirq
ex Plain
laln
Snding and seaihin9 usirg bi roy
h sondi
hi
Cinay SIah i
REud n eumendA, Vale
inlilad
OLt put end g eumO aay usirq
,middle-

eument of
find the micdle
ue

Value end-Valuela
elemd fourd.and
indey u
tuin cnd-Value= mitle
I f mi dd le-
Ve with
Olucmon!,cau
hi funtdion
R 3 1f midd
le >
stat -value
aiHh Stat-valae
.Cau the fund jon
eunands
Stepy1f middle <

midd le
dRSexH.
Bin suoNh

SO 11ed elument
oUdPue
ovWCiT to aN[n] ovey he atyy
See 1Tlerade o n t Pledesso I
eumnt
Compaut th cuwent mfDl
i1
sralle y than pye d ecessov,co
i f tho key is r o e ke gveadey ewnoat
ae
eumentbefove
t oothu Lements,
9 Pace fov the Swapre d e
moke
Position P Ho
with hupof
8olqicseoRO 4ths
a nead flow diagyam eXPlain
algov ithm desion
and aralysis PYOceAs
DiscuA) tha Vbrious91ge o/ algolithm des190
ond OAygi
osatys usro
low Chod.
mettad the PYattetn
pecide on:
Compudatio ral miaN.
eXat VAaPPlaxcinale
sloving agoVithm 8
Hechnidiue.

Desim an algoYihmk-

PYove covYecnesk

0
Aral 920 tha alSothm

code Hhuaugot t
ugdeslandi proble eduuuy do
uncevstand
tht PYoblem

Read the PVoblemA deciption


St alernank complete
types and use exiblinq
ayol ihm
the PYoblem
Td endi4y
|to find Solution.
d yange o inpu set fixed
(inslance) Ho hi Problem
an
inpul
iDecision mokir
com put adioroal device
PASCend irq the Capahi litos of he
exa on d aPPVOtimaie PYoblem solvinq
Choosirg beBween
algovithm design techntaues
ii) metod)) of s PeeifiGing on augov ithm
Theye ove thYee uway o sPe cify an augovlthm,
ratuval anguage
b PSe Udo Code
Clow Chalt.
6 So19lcsCoo8O
wl is sWi pYocessi r9 POvblemn?
alPhat
An choadeis fom
an
A Stviirq sis aa seavence o
chatlers
ond SPecial
Tt btvig letteYA, numbevs od ert
wold postevn is oderl
stvirq molchirg. $aualhirg fov given
eXam pieb. woyd
doturnot

www oy ina
N Phase on
CChino wOVd geromiC geavence.
Voad in tha vefevenre
9cauhirefo
uht rfor
o8hond
Desclibe ha 6landd algoli thm for find irg he birty fotm
Of a posiHive decimalinte jern
a) ergtish
|a pseudo Code
iy form vepRenla!ion Algo/ithm
o)Tnpul num beY

Oudpulbirdty numbev of given nwmbey


Siep le he decimal nwmbev be N
GHep:g:-Lel the B be ostvig vadiab1e to o ld he bind
PYe sendcehion. en of thoN

S1eps Repa tha folowirg slep y b wndil) wbecomes0


to
hi Rumainde
Slepy Divide he decimal numbeVbu by 9. let
U

beR and Quolient bea


Sleps: dViJe tho dbektdAYemaindet R t0 B o tho nert d1g
add
Of hib i r rum be
slep 6 AeSign he q uotiend the New de cini al numbelbM
6 PSeudo code
2019LcsCooRo
ne Num be YN aVay
oudpul-bi rohyof N
foY i-0 N>0 than
ati1 nv. 1
n nl
e nd foV

oV(i i-1,iz:0;i--)
PY inkf t1d ,ali])
hd fov
end.
slyukuye .
Aexplain the vaiaus linian dat a
tha dak a
elumonts

AnA lined dota stiuure 4vanbvevseCan


dada eument d idedly be veathld.
seavendially only
only one

ex AWayb linked listA, Salk etc


RN an avWoyisa coleelion Hemb sloved a contguou
muroYy 1o calions.The idea id Slove mu ltiPe itmp oftht
Sam lype dogethuVA oldel
dalatype tot oldA
an
abslraul
stalk A slauk is an isa lat fivst oud
in fivst out
HembA slatk
tinecm seawence o!
sluduve which fdllowS aoal
aPdt
etyduwe which fdllouws
Queue i9alint)
/9ueue A aVe PeVfolmed tho
which thaOpeyad ion
fealo ovde V n
rvdeY filt oul
9al9cséco8O
efine a glaph andthi Hem uced ingveph) ?
inolog i
pRA gvaph O hh ¬> is desined by a pail ofHwo sels
finile sel v o ilens calied vedicos and sele of veadex
a

Pait called edgeh.


Pesendad
Qdja cenuy mais
nXn
boo lean mad if iV°| isn
The eumuntA on he inYo w and i Ho column 1S) if ha an
Edge fovm th vel ey to tha jh veYtex o thaywi se.
Thd adjacen(y nafiiX of an undeteutee gaph sym met Vic

eljatenct tinkud s
Acolled ion of linked ist 1one fo Y
euh Yer le) ,tat
adjacent. 4 o He tistA verlex
Co ntain an the yeylice A
wei ghledphb wlh nombe 1) assigned lo fdp
tha
gvaphA ov d igaph)

Teymirol oPS as evter


eah rode of tho praph ig caluld
eer
Rath belueen tw0 VentICeð ora
C edge repveknd
tint belueen two ved1@s

Adlatenc:- Two node) ov esdiceh ave adjaunt if thty ave


coLat ed to euh othtVhYovgh an ed dgl.
Ralglcscoa8a
eXPlain Vaioub gyaph b epeurd ed in hon y eh.
adjacency mali
)ajalun ty ist
Vow and
with Yow)and
table wih
aj alenCy sel. hdughd
thoughi
of as a

malii r Ctun be
glaph.an
adaund y
adylnt
jacenty toode of
yepekndethi YOw ,Co
, c o lmn
lurmn

COlumn labels tho


he ro.0
no.0
Yow)

gd mallr wheve ths


mal Iu'
matru
VePlekd
9u'T Ve PYesd
SawaYe ceul of
Same.eath
and rode aVe
tho fOes.
onhtp belween two given
an
edgeOY hs yelat

veHer
of a laph, evely
list Yepvogntal ion may eithel contain
eitha contaln
Pn ad ja CenCy The
.The rude
rede ray inkad istist
a role objett tisl. This inked
tisl. his
veprOKnded as
d
H elevencey Ho a unkt
inked
to tfo
thouau Wont
Wert
a aljalendo
aijalent
d ata ov Ho
ta ale
llsB au rodes
Provides a
TD de.

Po9e
Qdja(enCy 5el mitigaBe a few o he challerges
h diHeV ent slead
thad irele
excep foY th
the adjacendy lis
verdiCs is Plovided
01 a tinked ist; a sel of adlang
SPDlgaph
aVe of en Used tov
adjacenty isl and se rodleb
bekween
o.1 th few ConnltionA
9019LcSCao&a
Define yeeb and thi eYmirolotieh Used in tees. i
a linked i61 nglead o
R a tYee dala Styuutuye Simil to
nert rode in d llniai PuGhion,
he
each rode Poirdiq 9imply to Saa exan
rodes TYee 18 exan Ple
ple o
o
of
eath tode poinda to a numbe Ve i9 auy of Yeh owPteynlire
0f veh
ron- ntaV dala sluudu ve. A dVee
astubiare in
a glaphial folm
ht hi
znthi eYayehial
evaYchial roduve o
a Rool Nooe.evely
1ee ave aloot
must aVe a lon!
RooTh fivslr ivst rode is caluled
node tink,
eluween any two rocb
betueenany two
Connutiq
eleIn tvee da strutiuve,the
N rode tha Ve
/e w l be
will inun
roX inuum
be rot

is cauld as edhe. TfatYeebas


o1 N-1 to ojedges caued as
urouysi s
cd-Te rode which is a pfeclecessoY o

POunt al chi ld
rode iS caued
descendan ol any
T l h i rnde nhich is
estimte he ro of times
rode
fincl acbl40.3y) bj aPplying uclid) folnula
mithod in an algoYHhm
ionA i don in ecicliat douwn do
Rudad indet oVm mn (m,D
bassed o nchutkirg consecutIve

8cd(m ,n)
anb lucidb algyithm
inpul a-60, broy
oulpul gcd t6o,3u)-12
60:8 IR (2 ((0 -2yau+1a)
3q:120RO [Bu 8X1240)
phn Reroindey R 0 the G is
thedivisiov. b in1adt eawations
ComPaven consecutive indegey chukirg indgel algovithm.The eucliads
foVmu la wil takes les comput e ime Because ind egey 4goYithm
lwe sould uVe do ChOLR uhYe two Aumbe ale gettire e ame integeys
Hele we aYe indu he gcd o Hwo num beln Sam ple way
dividirg.
in bt
&a19LcscaaeoVunnirq tim.
3How does inpud Si3e and
one meaSuye ho input i'g
the most foYmou gen Se thi gi1e of
Pnpud Si3e- în of a
rathl ne implemendali on
measuved
ed in vefeven ce toa
tuyiq
Qgol ih m. compuley
instludion
Hat a
looking ao sirgle
sirgle
unaigime An opelal lion is a sime
bers togethi
Y, ol
looKI ng
10mg.3ucha d i n g lwo m deleiminte
taue inan aYyay ave used o
mttod ayunts
SShow holw Opevaon cowmnsand 8 p
count

.deleymine
tha
OfendionA

ime o a PYagram
10r Ret .lwoNe and aveYoge ease
Ho bel he metod to i noralysiae
s t r c tion
of
NThe mtod is one instfufto
SteP.count at time> one
utfod ,we Coun htime compteat4
ha time compiezity
agovithmîn his we will ty to find
eX ec inq -fotm Had
0 agovithm.
algoYithm 4o peybIm sauenceliel seTdh
SuPPOse ha ve
we one

auh instuldiOT wil take elc C


---.

9uf
SuPPose
the
he
e than we will tYy lotind out
atound olHime ekan
Ho
ime compieTity of thi s algovihm.
do Sml gorted 1istuhich feads
8egtCa3P he wovst case igabig
But if youy in fot is gau to blq sorfed
|to Compleeityof (otn). times ancd since
Ond y Gna
is t. the algovithm eXecutes Hhe inne V foY
elumok ths algoYithm Hetmirals.
t don' tave o swBch
hao' y he aveYoge Ease
eoge coeIn compulalioral Compleaitu
,

o some vYDLunt compudalion


Complex iH4 0f ahgovith 1s he
an

algovih mavevag e oveV au POSSibe


YesouyCe used by
CormPlexity maSOYe he
tuoOYSt T n host CaSe

eSouvteat an algoy thm veawiVes an input of mbi tdy


onth Ve sou Vces Yeaute
on uppev Yound
9i2e.Jgives
by the algoYithm
2019lc scoo8o
elamples.
Sex Plain tha
exPlain th vmiOU a8gmplotic rolalion A wih
ae mainlythee asymlotlC rotalionh
.

doThese
Biq-o roialiond
Omaga rolaBions
dimeor
Thuarotalion. uPPeV bound of the Yanni
rq
the
?4 ePesend Complexeity
S9-09rolal fonb
gives he
woVst co9e
the aigorí hm
g t h m . T h U A Hg
an eondi hion
is in Yevelbe Yst Caseb.
diny wOYS Cases
u h n he inaut elemuntsi.e

imum time to SoY


Hakes
e s h tthe
hemot
tho lower bound of Yunniro tme
rega ptalons 9t ve pvesent A
i
1h0N iH
ithm gi ve best ca comp tetiHu se
Compleity of an algol aleady 9OYled, tho time
tho inpul onay is
b u b b l e sor, w hon he best o
ge.
ie dbove and kak
7Qkn by the gorthm inia funtt1on fYom
Thela enclose the
hl lawey &ound of the Vuunire
OiaIOnA ale
the upPe y he aveYage 0s
Since il Yepveentead fo
fo aralyi
aalyirq
.
is used
algoythm
ime
1ime
ot an
ComPlee nty. conSideYi lo
ig n-loo nd

eXPlatnthaSami
by
Owth 9
whal 1s 0ldeV g1dut inCfêns
in CYeos ecuvjon
auso
sn. ex
10HoY log n,niognand time Yeav Yemart fofnthevalue of
cvease
This
of nn-Thts
value ofn in
ns abhthe Value wih he increag e

ekehauiol of algovihm
behauiolof algo. ovdel
olde of gYouwth.
8 TowTh.
Callld
(alll d
behauiou y is
Ctarge inthe
h

nlog n n tog n

tO O.co03 08033 0-109

to 0-c0o1 6-066 uXlo


ellmant in an awvay o!
97 write an algoyithm tindirg the mox
Nbrnbev.

Pnput elumunt in an ayVauy


pultul Lolgelk eumand
The AiYssttwo eumentA of afVay ale Chuk ed andthe lalge of hete
t

tw o eumut A ale Placed 1n arvtn) chauked and lalge of Hose


ale
Sfh fiWstand thid eumont f arlay
Hwo elumuntA ave Pla (ed in ay[o1
ent ale
ewment
ale charkad
chonkad
and la
till he fivst
SThi9
Thi9 ProceNs conkinues
key wil be gloved in the aYY Co') pos
inthi
a Positio

The
h tavgok
lavaek Num
10 ChQLk
Whoatht Yan elemnt

an algor
ithm
wte
ite an ago
ave distincu
elwmenLA
araysid ot
P'nPut elumuna
eothk of distinek
Pudftul

d declou an aay

3 Tntiau3e an aay
dislinet e lemunth
4. eau o funttl0n fo ount
i1o 1
count vauahle and indiau3e
|9. pecladu a

o becloA two foY lo0ps


eument
oopb toliSond avYay
Use the fiVst duPli cake euement plovisirg no
IdolP fo
6econd loop 1o looP foY
Provios iray ot coute
Count eumonkA
ouiab le it
Toelma'ral he coun
Vduable
Retuvn ht Count

end
ComPut irg/1 boran ce, jes
sev
algovithm fo
wYie an

Qun
algo1ithm

Declal i,a, b,ghouw


O
8- initaule tho voi able a= Oi b- \ and ghow-
L.enleve ro-of tevm) of fibo na@Ci sevie^ to be pinles
pYint Prrst tw0 He Ym of sevie.
ol bojs , < . h
(ubonucu<
(o)6ot Olbo15
a97
(ubonu) (u)
((r-u)6o). (-0))= i(t-u)
bS T ( -u) fmoIR
,(00ltu) o
,8
t d9.ADSOP
PAODO0 uomut bjmojlof
10 NOPMO A} OF bu
pua
moy9 lo YonDi rHt rlnd
hq guly} po o angoA as vaAJul
mo4s
qtDmojS
Yde19 bu|mo{oJ Ao doon asm
Opoo3S BTDE

You might also like