<s>
Sorting	B-Algorithm
refers	O
to	O
ordering	O
data	O
in	O
an	O
increasing	O
or	O
decreasing	O
manner	O
according	O
to	O
some	O
linear	O
relationship	O
among	O
the	O
data	O
items	O
.	O
</s>
<s>
In	O
,	O
arranging	O
in	O
an	O
ordered	O
sequence	O
is	O
called	O
"	O
sorting	B-Algorithm
"	O
.	O
</s>
<s>
Sorting	B-Algorithm
is	O
a	O
common	O
operation	O
in	O
many	O
applications	O
,	O
and	O
efficient	O
algorithms	B-Algorithm
to	O
perform	O
it	O
have	O
been	O
developed	O
.	O
</s>
<s>
making	O
lookup	B-Application
or	I-Application
search	I-Application
efficient	O
;	O
</s>
<s>
making	O
merging	B-Algorithm
of	I-Algorithm
sequences	I-Algorithm
efficient	O
.	O
</s>
<s>
enable	O
processing	B-General_Concept
of	I-General_Concept
data	I-General_Concept
in	O
a	O
defined	O
order	O
.	O
</s>
<s>
The	O
opposite	O
of	O
sorting	B-Algorithm
,	O
rearranging	O
a	O
sequence	O
of	O
items	O
in	O
a	O
random	O
or	O
meaningless	O
order	O
,	O
is	O
called	O
shuffling	O
.	O
</s>
<s>
For	O
sorting	B-Algorithm
,	O
either	O
a	O
weak	O
order	O
,	O
"	O
should	O
not	O
come	O
after	O
"	O
,	O
can	O
be	O
specified	O
,	O
or	O
a	O
strict	O
weak	O
order	O
,	O
"	O
should	O
come	O
before	O
"	O
(	O
specifying	O
one	O
defines	O
also	O
the	O
other	O
,	O
the	O
two	O
are	O
the	O
complement	O
of	O
the	O
inverse	O
of	O
each	O
other	O
,	O
see	O
operations	O
on	O
binary	O
relations	O
)	O
.	O
</s>
<s>
For	O
the	O
sorting	B-Algorithm
to	O
be	O
unique	O
,	O
these	O
two	O
are	O
restricted	O
to	O
a	O
total	O
order	O
and	O
a	O
strict	O
total	O
order	O
,	O
respectively	O
.	O
</s>
<s>
Sorting	B-Algorithm
n-tuples	O
(	O
depending	O
on	O
context	O
also	O
called	O
e.g.	O
</s>
<s>
The	O
first	O
is	O
then	O
called	O
the	O
primary	B-Algorithm
sort	I-Algorithm
key	I-Algorithm
,	O
the	O
second	O
the	O
secondary	B-Algorithm
sort	I-Algorithm
key	I-Algorithm
,	O
etc	O
.	O
</s>
<s>
For	O
example	O
,	O
addresses	O
could	O
be	O
sorted	O
using	O
the	O
city	O
as	O
primary	B-Algorithm
sort	I-Algorithm
key	I-Algorithm
,	O
and	O
the	O
street	O
as	O
secondary	B-Algorithm
sort	I-Algorithm
key	I-Algorithm
.	O
</s>
<s>
If	O
the	O
sort	O
key	O
values	O
are	O
totally	O
ordered	O
,	O
the	O
sort	O
key	O
defines	O
a	O
weak	O
order	O
of	O
the	O
items	O
:	O
items	O
with	O
the	O
same	O
sort	O
key	O
are	O
equivalent	O
with	O
respect	O
to	O
sorting	B-Algorithm
.	O
</s>
<s>
See	O
also	O
stable	O
sorting	B-Algorithm
.	O
</s>
<s>
Bubble/Shell	O
sort	O
:	O
Exchange	O
two	O
adjacent	O
elements	O
if	O
they	O
are	O
out	O
of	O
order	O
.	O
</s>
<s>
Insertion	B-Algorithm
sort	I-Algorithm
:	O
Scan	O
successive	O
elements	O
for	O
an	O
out-of-order	O
item	O
,	O
then	O
insert	O
the	O
item	O
in	O
the	O
proper	O
place	O
.	O
</s>
<s>
Selection	B-Algorithm
sort	I-Algorithm
:	O
Find	O
the	O
smallest	O
(	O
or	O
biggest	O
)	O
element	O
in	O
the	O
array	O
,	O
and	O
put	O
it	O
in	O
the	O
proper	O
place	O
.	O
</s>
<s>
Quick	B-Algorithm
sort	I-Algorithm
:	O
Partition	O
the	O
array	O
into	O
two	O
segments	O
.	O
</s>
<s>
Merge	B-Algorithm
sort	I-Algorithm
:	O
Divide	O
the	O
list	O
of	O
elements	O
in	O
two	O
parts	O
,	O
sort	O
the	O
two	O
parts	O
individually	O
and	O
then	O
merge	O
it	O
.	O
</s>
<s>
Various	O
sorting	B-Algorithm
tasks	O
are	O
essential	O
in	O
industrial	O
processes	O
.	O
</s>
<s>
For	O
example	O
,	O
during	O
the	O
extraction	O
of	O
gold	O
from	O
ore	O
,	O
a	O
device	O
called	O
a	O
shaker	O
table	O
uses	O
gravity	O
,	O
vibration	B-Algorithm
,	O
and	O
flow	O
to	O
separate	O
gold	O
from	O
lighter	O
materials	O
in	O
the	O
ore	O
(	O
sorting	B-Algorithm
by	O
size	O
and	O
weight	O
)	O
.	O
</s>
<s>
Sorting	B-Algorithm
is	O
also	O
a	O
naturally	O
occurring	O
process	O
that	O
results	O
in	O
the	O
concentration	O
of	O
ore	O
or	O
sediment	O
.	O
</s>
<s>
Sorting	B-Algorithm
results	O
from	O
the	O
application	O
of	O
some	O
criterion	O
or	O
differential	O
stressors	O
to	O
a	O
mass	O
to	O
separate	O
it	O
into	O
its	O
components	O
based	O
on	O
some	O
variable	O
quality	O
.	O
</s>
<s>
Optical	B-General_Concept
sorting	I-General_Concept
is	O
an	O
automated	O
process	O
of	O
sorting	B-Algorithm
solid	O
products	O
using	O
cameras	O
and/or	O
lasers	O
and	O
has	O
widespread	O
use	O
in	O
the	O
food	O
industry	O
.	O
</s>
<s>
Sensor-based	O
sorting	B-Algorithm
is	O
used	O
in	O
mineral	O
processing	O
.	O
</s>
