0 ratings0% found this document useful (0 votes) 13 views10 pagesData Structures
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
a... |
Ee A 8 MemoNo,
‘Su[Mo] Tu [Wel Th| Fr [Sa Date : I /
ala shucluce
“Time Comple si-y for Algorithms
Freq vency
SS
_int arf] -fiso}: : re
4
4
(ok n= ares denolh
wl Sum =o!
Cor Cink io" jen ithe A
Sum = sumsarrfi]° a
%
[ante]
=> Ths 1s cated a Eveguenry Coun).ng method
= re Einding “Time. i )
a " ‘eg cet We oy)! Use _
Big oh Nobalion Co Sr Sae
4) Eliminale Can shanks
2) Relan The h gest ordered berm
Scanned with CamScanneryoo. Bag |
pe [Su]Mo] tu ]Wel Th] Fr [s:
“nValue inevease time alsa incwase
¥
;
tn
\ =>.
entample : 9 : one
= ay]
HES
Code € veguency
for Cink iro: zn! tte) § nta
for Cink i:0. jen jen fh ne (nt +t)
System oul print Chay Nxn
¥
System -ouk- prinh. ney n
4
=
DAO eA NEN > Cline Conctade
Ment nenttn
dnt 30 => Lhimnale Cnsharts
+, . .
n 4p > Relay highest ordered hen
w) ‘
m
é
>
Ree
Scanned with CamScanneron
S| Sj MemoNo.
‘Su]Mo] Tu We] Th] Fr [Sa Date : / /
i) Mulhiphag tivo malux :
Foe
VAY
Co de
SS
for Cink ico. ten’ ite) t
for ink j:0° iZn jer)f
CLitC sy] 20!
or Cink Keot Ken” kee) f
cL i]. chite so] eafiTee)? bee est:
?
D+1 tn tn tn tp en +n3
Qn> + 3n-+ 20
Wen en
n?
0 Cr?)
ee
Scanned with CamScannerMemo No. Bae
pate: ff ogee (SulMo] Ta [Wel th[ Fr [Sa
) Te
Wealprn = 2 x 6S 49417
es Tye
Wee x eK
Code Evegvency
ie’, tr +
4
Sor { ink ro jezil jer) d CoD tn
Syslem sou}. pridk ¥ a %)+ nary
=
4
Sysbem -ou}-prinblaC) ! -
4
Dt 1+ ON +N + nen 4A
on)
sum of naburl aunbers iE pCa+)
2
|
Scanned with CamScannera 2G =
was MemoNo.
‘Su]Mo] Tu [We] Th] Fr [Sa Date : I '
CorCinkico: Pee ny ive) f
Pz pxi"
5 5
-2 °
s orl
= orxtye
7 Orlrrr3
= OTUr2+3r.. +E
ea Asheve
k(kxt) sn
eo
ko af im)
= Nole -
Kn ea: —
Z oh sn SnD Jn > logn
Te > fo maples tas a se
aged
abe n
Scanned with CamScanneris
T&6
a - aes
bee ! ‘Su[Mo] Tu [We] Th] Fr
@code:
_forCis tt ‘ens 2 2df Te
Uf S\shemenks nen 2
LE LKLXLAZ 2?
Lxrxtrts2 oh
“Términa) on _condifion -
ak >=
ak=n
Jo9, C2k)= [09,0
k \ed2-a- = 109,N
(
Kk: le9.
© Cledzn) r) O Clean)
Note’-
Ola strclure’s ove Used fo achevea less
Space and ne. Complenily- \ i}. Good
Maths.
SSS
SEE
Scanned with CamScannerra aS é MemoNo,
(Su]Mo[ tu Wel th Fr [Sa] Date : / /
Fac bertal of a Munber
Tndaray Ss UTE
4) ITERATVE 9) RECURS Ive
| rigor Tauarubil S canney"’
| O_class focloti§
| Stabic ink fach C ink og
Ink pes < |
forC itt) i2=n} itt)?
ee serena
4
Veluvn yes’
4
public slalic void main (Staaf J aris) f
Scannev 6c = new Scanner ( Sys [Link] )
in} = _NexlEnt C)*
Si: hem aut-pn'n} Ln CfhackC ny) *
4
4
—_
a
Scanned with CamScannerMemo No. Be A] (S]
Date : / / ['Su]Mo] Tu [We] Th] Fr [Sa
Gcp.d Hef
——=
> _for A u o She
GQ “fovcnd of Alenandria ” Cind gasia sk
Mau, =
=> Euclid of Alenandvia. (Jos_4 one of Me greal-
Mathamaljtan «
=> Based on His Appoch . New Algothn lo
Find Ge tor) LE
Igor) thm * Sueli ertandria.”
———
_4. Find the larger ruler
b difference
“alee —- and_smalle? number:
3. Repeat shep2 unlit bolh numbers become
caval
te. Relurn _any_ene, number, which ts the GcD
_O Cimon Ca,4))
Scanned with CamScanner| 8 Pas) Memo No.
(Su[Mo] Tu [We] Th] Fr [Sa Date : yoy
GABRIEL LAME
=> We foke the * Fuerid of Alewndria” Apprech
and change the “'subrachon” park bo“ Divielan”
=> This made fosicr’ and _fasler Than
Evaid Appyoch .
Algorithm C Based an Gani) Lave”)
A. find the larger nomber
Q- Divide the larger number cuit “smaller_punder
and Remader Feplace canth large nunder
3B. Repea} Te 9. sleps fit become
Final value sil be The acd
Thiste a optimised Euclid Agocilhm
ee
tg (nin Cab)
Scanned with CamScanner
anMemo No. He] [BI [D
ae t / Su[Mo] Tu [We] th] Fr [Sa
See
public class bcd}
bea ' ' } ny ‘ ) {
_slakic int evctidGed Cint aint b) ¢
While (al=o£& hiro) ¢
i Cash)
a= ayh’
qelse f
b= bya)
¥
i
if Cayrof
yehrn a}
Yelse f
ye _Yelun 3
4
y
public stable void man C S)ing6t args )d
Scaner _s > new Scanner’ ( System «in!
H oO = Snot vob C)!
| inth 2. 5.
J
" Scanned with CamScanner