Professional Documents
Culture Documents
Adobe Scan Mar 11, 2022
Adobe Scan Mar 11, 2022
SAaat
i-0 lag:0
Read
Reccl beouth
Reaod aucy
OA (o, <n i++)n
a i - =Seaseh)
brecuk
(g)
rint ound ")
lse
Pon rof found");|
Akop
Loltecting ganizing docta talled data ShructuAL
Trees Pphs
Steck Tue inked List
Haaithinetic Analyis
m tuu0 actor
algosthrm basftally depe ncs
am0um+
oime equi're
The is lalled
Time lomplexl and eneut he Procpom
Lompile
APOLe Cbmpleailg9 omplety
time
Calltd
*h Pam
Dk pare oCt upied by
yThe amoun
iH Apate (emplezi
56 IKb, 6 Kb
En the olgoaihm,
talulate
hhehime lompleu
I n oden
a . s y m p ot i c otation.
neeol
ane
hee pe ayrpotie otation
Thene
3)Teta (ase
n
vo lue o
C.g)
m e
Lw tin
C19n))
ti
Theta Po
Auch th3l
tni)t a
tongtant Ci, (,
Glg
)2 h(n) C 9(n) va lu
C 9 (n)
fimt
Cgn)
nd : m tn
n 2 6n
m ctim
n:t) 6 6
n 2
Read
3 Sum = O
Co)2 C9()
o r -1 , i n, 144 n1hC: 6 .(n)
um
6 C J) n
Sprit Sum Henu inu Lonpux O ln)
8hop
1 Dengn Om
aloyoni thm t
id ih anpleri ty
dimensmal mahix
Sum element tn tuo
i) Bubble Sont
n ineau Seueh
C g)
) S+aat
Reodn, AumO
Reod ouay (n)
or (1:o 7kn +) (n+
o j4n,j++) )
Prit Zduny
AhOP
Bubble Sort
SHant
n )
+n+3n n
Reacd , , i,
3Read 0AD n) n+6n +3
kOA (i:o, ?u:n-t i+a)
aCalj0; n
i 0 ; ic n-i, 9 )
n
pint4(7a, alji0); n
ineoc
infol So1t
il, lag
Reced n
Reud Rarek
S. Riad olay
n+
o(i: fen) n
( se
breo
7print ound
AP
Aorting
Tuo tpes
TnreAnal orting
hel 0Nt
henp A0n
meuge Aont
B u t k e t bttt
unsention aM cn all 4he elevn emR
in ht 13 cosd 9a
Meg h (aidt
elemtnt Qlenent
(ompaAR hirs
nf eded, dhemufe
t ate
ppi needrd
1 2 36
6
S
8 3 6 4
6 4
S
6
73 6
76
2 3 S 73
2 3 S
3 S
6 89
Thsentiom Sant
int
( .&", a);
ptan
i j-
mp: a Ljl
while Ci>= o empe alyV
2
Tnoenuam SontAlaole
ali ewp
en Ci: 0, 1 n, i+#)
The time
tomplenit k imsetinq 0Atinq best ta
on)
Shell Sont
s than element
abo
thn Lomtinue
n D12 hen 6
9P
which àl P
agaun ind the
P T 4P
Nepe a t AOme Pro cessS ele vnemt
Compohec
betome ihi
again id Hhe
3°P/2 hn P
P P
peoAm Jmaeltion
1 3 2
I4 22 12 29
09 49
3 2 6
122 2 S )4
I22
2
L 2 2 S
61 5
9P: 3
12a
2 2 6 4 u 2
2 122 to9 2 6
09122 6 149/2S
6 lo 22 1 12 149 25 2
1 61 09
23
12 2 61
12S 149
34 6 (2
ShellShell Sont_Ceda
inttude <sidio. h>
Vocl mcin ()
int gop, i j , k , t ,
int a ]
print+("ene thu numbeis");
oa i:0?en) itt)
break
Qise
t [k J;
o
[r) o
[«4g°P]
C q J : *;
7
1
Pvint(" d elenmtnH a n");
he Hme
templexi ly e L best coe O
amd im
(ople lo Dhst go caM
O(n):
wket Sont
BucRe Sont i s aAorting algonithm -Hhat dfuides he
ptueal houpf talled
UnJOA Rd
ANay elemenH
bucker
The bueket
3e vauies hom o o
9
hen Pla le hou
In numbe 3
Rrst
an
in hrcd plau. Lonsiders it vnit plate
based o unil
Unil
Neac lare
bucketuu'se
ele nent in
cul he
he neu P eotlec
numb
tens
ten plate
by +aking
Repea h Aame
mauke
it om est
es
amd
n d pla u
plau
elemen
onhltht cll
Repeat +he me protess
AOA ed GAde
321S
qu3 , 138, us6, o l ,
u s b u , 2%61,
S G
321S
3
H564
C4 32
661
3
2
38
oll/
S64, 456
311S, ai28, 7u 3 9 , 6 6 / ,
I
S 6
66
qu39 yS6y
2138
66 u
2133 3 S
22u
uck Sort
GucK &0At uses he Shraegy taited divide
divide omd (orq uelt
ied a p i u o t element
TK k lenent
33 66 8 SS
33 66 83
21 33
66
37 2 1
q 66 88 SS
PL
66
SS
66
J
66
66
33
2 33
11 2 33 SS 66 9
Muge Soxt
+his
meHging he elemen
nH nlu whi ch Omg
elemum
Again tom bine o)»
and)
and
n element which oms
mau eltmênt memt which
u in kd
bon
ohdlA
(A
N
1 /
7615
3 l1 6
2 3 6 8 9
tintludls stdio.hs
tmouin )
A9Ot (-1)
herp [ool hsop Ce7)
dop hecp Caoo),
htapt);
hap Faoot]
heapt) t
while C! o)
e Ci:ns-I jè0j-
emp heap [o3
heapCo heap lji
heap ) tmp
do
0 0+
heap tlt heap t ) e
<j-i)
taj)
tnp heap [aoot J;
htsp aeotJ: eo
heap le) temp
plo;
Prin+" AONHd aMy is ")
Ai:0 en o it)
pintl" 3d", hep ))
Jetu o
Tme Lomplev9
lm}2) +
( ) +n O
n)+(»/u) + +nlu)+"/
t(nlu) 4 2n -
nn
4n«) +un
+(n) (nl,:)+ +n*i
n
iog. =deg
r n : i )4(n): nlo2n
C-) 2
o(n