Professional Documents
Culture Documents
Daa
Daa
saDivi
deandConqueral
gor
it
hm.I
tpicksanelementaspi
votandpartit
ionst
he
gi
venar r
ayaroundt
hepickedpi
vot
.Ther
earemanydiff
erentv
ersi
onsofQuicksor
tthatpi
ck
pi
votindif
fer
entway
s.
MergeSorti
saDi v
ideandConqueral
gor
it
hm.Itdi
vi
desi
nputar
rayi
ntwo
hal
ves,
call
sit
sel
ffort
hetwohal
vesandthenmergest
het
wosor
ted
observedthatoutofall sort
ingalgor
it
hmsi fr
unti
mewas
consideredIt
erativ
eMer geSor twast heworstf
oll
owedbyRecursi
ve
MergeSor t.WhilebothQuickSor tswereverycl
oseinrunt
imeRecursi
ve
wascl earl
yfasterforl
argeinputsizes.
TheTabl
ebel
owgi
vest
ime(
s)t
akenbyeachsor
tforv
aluesofn:
Comput
ingt
heMemor
ytakenf
orn=10000
Tot
alMemory
used(
MB) Act
ual
Memor
yused(
MB)
I
nit
ial
Bef
oreSor
t 73.
98 0
Mer
geSor
t(Recur
siv
e) 73.
98 73.
98
Qui
ckSor
t(Recur
siv
e) 73.
96 0.
002
Qui
ckSor
t(I
ter
ati
ve) 73.
97 0.
001
Merge
Sor
t (
It
erat
ive) 73.
98 0.
001