<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
the	O
analysis	B-General_Concept
of	I-General_Concept
algorithms	I-General_Concept
is	O
the	O
process	O
of	O
finding	O
the	O
computational	O
complexity	O
of	O
algorithms	O
—	O
the	O
amount	O
of	O
time	O
,	O
storage	O
,	O
or	O
other	O
resources	B-General_Concept
needed	O
to	O
execute	O
them	O
.	O
</s>
<s>
Different	O
inputs	O
of	O
the	O
same	O
size	O
may	O
cause	O
the	O
algorithm	O
to	O
have	O
different	O
behavior	O
,	O
so	O
best	B-General_Concept
,	I-General_Concept
worst	I-General_Concept
and	I-General_Concept
average	I-General_Concept
case	I-General_Concept
descriptions	O
might	O
all	O
be	O
of	O
practical	O
interest	O
.	O
</s>
<s>
When	O
not	O
otherwise	O
specified	O
,	O
the	O
function	O
describing	O
the	O
performance	O
of	O
an	O
algorithm	O
is	O
usually	O
an	O
upper	O
bound	O
,	O
determined	O
from	O
the	O
worst	B-General_Concept
case	I-General_Concept
inputs	O
to	O
the	O
algorithm	O
.	O
</s>
<s>
The	O
term	O
"	O
analysis	B-General_Concept
of	I-General_Concept
algorithms	I-General_Concept
"	O
was	O
coined	O
by	O
Donald	O
Knuth	O
.	O
</s>
<s>
Algorithm	B-General_Concept
analysis	I-General_Concept
is	O
an	O
important	O
part	O
of	O
a	O
broader	O
computational	O
complexity	O
theory	O
,	O
which	O
provides	O
theoretical	O
estimates	O
for	O
the	O
resources	B-General_Concept
needed	O
by	O
any	O
algorithm	O
which	O
solves	O
a	O
given	O
computational	O
problem	O
.	O
</s>
<s>
These	O
estimates	O
provide	O
an	O
insight	O
into	O
reasonable	O
directions	O
of	O
search	O
for	O
efficient	B-General_Concept
algorithms	I-General_Concept
.	O
</s>
<s>
In	O
theoretical	O
analysis	B-General_Concept
of	I-General_Concept
algorithms	I-General_Concept
it	O
is	O
common	O
to	O
estimate	O
their	O
complexity	O
in	O
the	O
asymptotic	O
sense	O
,	O
i.e.	O
,	O
to	O
estimate	O
the	O
complexity	O
function	O
for	O
arbitrarily	O
large	O
input	O
.	O
</s>
<s>
A	O
model	O
of	O
computation	O
may	O
be	O
defined	O
in	O
terms	O
of	O
an	O
abstract	B-Application
computer	I-Application
,	O
e.g.	O
</s>
<s>
Turing	B-Architecture
machine	I-Architecture
,	O
and/or	O
by	O
postulating	O
that	O
certain	O
operations	O
are	O
executed	O
in	O
unit	O
time	O
.	O
</s>
<s>
The	O
latter	O
is	O
more	O
cumbersome	O
to	O
use	O
,	O
so	O
it	O
's	O
only	O
employed	O
when	O
necessary	O
,	O
for	O
example	O
in	O
the	O
analysis	O
of	O
arbitrary-precision	B-Algorithm
arithmetic	I-Algorithm
algorithms	O
,	O
like	O
those	O
used	O
in	O
cryptography	O
.	O
</s>
<s>
Run-time	B-General_Concept
analysis	I-General_Concept
is	O
a	O
theoretical	O
classification	O
that	O
estimates	O
and	O
anticipates	O
the	O
increase	O
in	O
running	O
time	O
(	O
or	O
run-time	O
or	O
execution	O
time	O
)	O
of	O
an	O
algorithm	O
as	O
its	O
input	O
size	O
(	O
usually	O
denoted	O
as	O
)	O
increases	O
.	O
</s>
<s>
Run-time	O
efficiency	O
is	O
a	O
topic	O
of	O
great	O
interest	O
in	O
computer	B-General_Concept
science	I-General_Concept
:	O
A	O
program	B-Application
can	O
take	O
seconds	O
,	O
hours	O
,	O
or	O
even	O
years	O
to	O
finish	O
executing	O
,	O
depending	O
on	O
which	O
algorithm	O
it	O
implements	O
.	O
</s>
<s>
While	O
software	O
profiling	O
techniques	O
can	O
be	O
used	O
to	O
measure	O
an	O
algorithm	O
's	O
run-time	O
in	O
practice	O
,	O
they	O
cannot	O
provide	O
timing	O
data	O
for	O
all	O
infinitely	O
many	O
possible	O
inputs	O
;	O
the	O
latter	O
can	O
only	O
be	O
achieved	O
by	O
the	O
theoretical	O
methods	O
of	O
run-time	B-General_Concept
analysis	I-General_Concept
.	O
</s>
<s>
Since	O
algorithms	O
are	O
platform-independent	B-Operating_System
(	O
i.e.	O
</s>
<s>
a	O
given	O
algorithm	O
can	O
be	O
implemented	O
in	O
an	O
arbitrary	O
programming	O
language	O
on	O
an	O
arbitrary	O
computer	O
running	O
an	O
arbitrary	O
operating	B-General_Concept
system	I-General_Concept
)	O
,	O
there	O
are	O
additional	O
significant	O
drawbacks	O
to	O
using	O
an	O
empirical	O
approach	O
to	O
gauge	O
the	O
comparative	O
performance	O
of	O
a	O
given	O
set	O
of	O
algorithms	O
.	O
</s>
<s>
Take	O
as	O
an	O
example	O
a	O
program	B-Application
that	O
looks	O
up	O
a	O
specific	O
entry	O
in	O
a	O
sorted	O
list	O
of	O
size	O
n	O
.	O
Suppose	O
this	O
program	B-Application
were	O
implemented	O
on	O
Computer	O
A	O
,	O
a	O
state-of-the-art	O
machine	O
,	O
using	O
a	O
linear	B-Algorithm
search	I-Algorithm
algorithm	I-Algorithm
,	O
and	O
on	O
Computer	O
B	O
,	O
a	O
much	O
slower	O
machine	O
,	O
using	O
a	O
binary	O
search	O
algorithm	O
.	O
</s>
<s>
Computer	O
A	O
,	O
running	O
the	O
linear	B-Algorithm
search	I-Algorithm
program	B-Application
,	O
exhibits	O
a	O
linear	O
growth	O
rate	O
.	O
</s>
<s>
The	O
program	B-Application
's	O
run-time	O
is	O
directly	O
proportional	O
to	O
its	O
input	O
size	O
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
Computer	O
B	O
,	O
running	O
the	O
binary	O
search	O
program	B-Application
,	O
exhibits	O
a	O
logarithmic	O
growth	O
rate	O
.	O
</s>
<s>
For	O
example	O
,	O
since	O
the	O
run-time	O
of	O
insertion	B-Algorithm
sort	I-Algorithm
grows	O
quadratically	O
as	O
its	O
input	O
size	O
increases	O
,	O
insertion	B-Algorithm
sort	I-Algorithm
can	O
be	O
said	O
to	O
be	O
of	O
order	O
.	O
</s>
<s>
Big	O
O	O
notation	O
is	O
a	O
convenient	O
way	O
to	O
express	O
the	O
worst-case	B-General_Concept
scenario	I-General_Concept
for	O
a	O
given	O
algorithm	O
,	O
although	O
it	O
can	O
also	O
be	O
used	O
to	O
express	O
the	O
average-case	B-General_Concept
for	O
example	O
,	O
the	O
worst-case	B-General_Concept
scenario	I-General_Concept
for	O
quicksort	B-Algorithm
is	O
,	O
but	O
the	O
average-case	B-General_Concept
run-time	O
is	O
.	O
</s>
<s>
The	O
run-time	O
complexity	O
for	O
the	O
worst-case	B-General_Concept
scenario	I-General_Concept
of	O
a	O
given	O
algorithm	O
can	O
sometimes	O
be	O
evaluated	O
by	O
examining	O
the	O
structure	O
of	O
the	O
algorithm	O
and	O
making	O
some	O
simplifying	O
assumptions	O
.	O
</s>
<s>
Consider	O
the	O
following	O
pseudocode	B-Language
:	O
</s>
<s>
For	O
a	O
worst-case	B-General_Concept
evaluation	O
,	O
it	O
should	O
be	O
assumed	O
that	O
step	O
3	O
will	O
be	O
run	O
as	O
well	O
.	O
</s>
<s>
The	O
inner	O
loop	O
,	O
on	O
the	O
other	O
hand	O
,	O
is	O
governed	O
by	O
the	O
value	O
of	O
j	O
,	O
which	O
iterates	B-Algorithm
from	O
1	O
to	O
i	O
.	O
</s>
<s>
On	O
the	O
first	O
pass	O
through	O
the	O
outer	O
loop	O
,	O
j	O
iterates	B-Algorithm
from	O
1	O
to	O
1	O
:	O
The	O
inner	O
loop	O
makes	O
one	O
pass	O
,	O
so	O
running	O
the	O
inner	O
loop	O
body	O
(	O
step	O
6	O
)	O
consumes	O
T6	O
time	O
,	O
and	O
the	O
inner	O
loop	O
test	O
(	O
step	O
5	O
)	O
consumes	O
2T5	O
time	O
.	O
</s>
<s>
During	O
the	O
next	O
pass	O
through	O
the	O
outer	O
loop	O
,	O
j	O
iterates	B-Algorithm
from	O
1	O
to	O
2	O
:	O
the	O
inner	O
loop	O
makes	O
two	O
passes	O
,	O
so	O
running	O
the	O
inner	O
loop	O
body	O
(	O
step	O
6	O
)	O
consumes	O
2T6	O
time	O
,	O
and	O
the	O
inner	O
loop	O
test	O
(	O
step	O
5	O
)	O
consumes	O
3T5	O
time	O
.	O
</s>
<s>
The	O
methodology	O
of	O
run-time	B-General_Concept
analysis	I-General_Concept
can	O
also	O
be	O
utilized	O
for	O
predicting	O
other	O
growth	O
rates	O
,	O
such	O
as	O
consumption	O
of	O
memory	B-Language
space	I-Language
.	O
</s>
<s>
As	O
an	O
example	O
,	O
consider	O
the	O
following	O
pseudocode	B-Language
which	O
manages	O
and	O
reallocates	O
memory	O
usage	O
by	O
a	O
program	B-Application
based	O
on	O
the	O
size	O
of	O
a	O
file	B-Operating_System
which	O
that	O
program	B-Application
manages	O
:	O
</s>
<s>
while	O
file	B-Operating_System
is	O
still	O
open	O
:	O
</s>
<s>
In	O
this	O
instance	O
,	O
as	O
the	O
file	B-Operating_System
size	O
n	O
increases	O
,	O
memory	O
will	O
be	O
consumed	O
at	O
an	O
exponential	O
growth	O
rate	O
,	O
which	O
is	O
order	O
.	O
</s>
<s>
This	O
is	O
an	O
extremely	O
rapid	O
and	O
most	O
likely	O
unmanageable	O
growth	O
rate	O
for	O
consumption	O
of	O
memory	O
resources	B-General_Concept
.	O
</s>
<s>
Algorithm	B-General_Concept
analysis	I-General_Concept
is	O
important	O
in	O
practice	O
because	O
the	O
accidental	O
or	O
unintentional	O
use	O
of	O
an	O
inefficient	O
algorithm	O
can	O
significantly	O
impact	O
system	O
performance	O
.	O
</s>
<s>
Analysis	B-General_Concept
of	I-General_Concept
algorithms	I-General_Concept
typically	O
focuses	O
on	O
the	O
asymptotic	O
performance	O
,	O
particularly	O
at	O
the	O
elementary	O
level	O
,	O
but	O
in	O
practical	O
applications	O
constant	O
factors	O
are	O
important	O
,	O
and	O
real-world	O
data	O
is	O
in	O
practice	O
always	O
limited	O
in	O
size	O
.	O
</s>
<s>
The	O
limit	O
is	O
typically	O
the	O
size	O
of	O
addressable	O
memory	O
,	O
so	O
on	O
32-bit	O
machines	O
232	O
=	O
4	O
GiB	O
(	O
greater	O
if	O
segmented	B-General_Concept
memory	I-General_Concept
is	O
used	O
)	O
and	O
on	O
64-bit	O
machines	O
264	O
=	O
16	O
EiB	O
.	O
</s>
<s>
This	O
interpretation	O
is	O
primarily	O
useful	O
for	O
functions	O
that	O
grow	O
extremely	O
slowly	O
:	O
(	O
binary	O
)	O
iterated	B-Algorithm
logarithm	O
(	O
log*	O
)	O
is	O
less	O
than	O
5	O
for	O
all	O
practical	O
data	O
(	O
265536	O
bits	O
)	O
;	O
(	O
binary	O
)	O
log-log	O
(	O
log	O
log	O
n	O
)	O
is	O
less	O
than	O
6	O
for	O
virtually	O
all	O
practical	O
data	O
(	O
264	O
bits	O
)	O
;	O
and	O
binary	O
log	O
(	O
log	O
n	O
)	O
is	O
less	O
than	O
64	O
for	O
virtually	O
all	O
practical	O
data	O
(	O
264	O
bits	O
)	O
.	O
</s>
<s>
This	O
is	O
particularly	O
used	O
in	O
hybrid	B-Algorithm
algorithms	I-Algorithm
,	O
like	O
Timsort	B-Algorithm
,	O
which	O
use	O
an	O
asymptotically	O
efficient	B-General_Concept
algorithm	I-General_Concept
(	O
here	O
merge	B-Algorithm
sort	I-Algorithm
,	O
with	O
time	O
complexity	O
)	O
,	O
but	O
switch	O
to	O
an	O
asymptotically	O
inefficient	O
algorithm	O
(	O
here	O
insertion	B-Algorithm
sort	I-Algorithm
,	O
with	O
time	O
complexity	O
)	O
for	O
small	O
data	O
,	O
as	O
the	O
simpler	O
algorithm	O
is	O
faster	O
on	O
small	O
data	O
.	O
</s>
