<s>
Gnome	B-Algorithm
sort	I-Algorithm
(	O
nicknamed	O
stupid	O
sort	O
)	O
is	O
a	O
variation	O
of	O
the	O
insertion	B-Algorithm
sort	I-Algorithm
sorting	B-Algorithm
algorithm	I-Algorithm
that	O
does	O
not	O
use	O
nested	O
loops	O
.	O
</s>
<s>
Gnome	B-Algorithm
sort	I-Algorithm
was	O
originally	O
proposed	O
by	O
Iranian	O
computer	O
scientist	O
Hamid	O
Sarbazi-Azad	O
(	O
professor	O
of	O
Computer	O
Science	O
and	O
Engineering	O
at	O
Sharif	O
University	O
of	O
Technology	O
)	O
in	O
2000	O
.	O
</s>
<s>
The	O
sort	O
was	O
first	O
called	O
stupid	O
sort	O
(	O
not	O
to	O
be	O
confused	O
with	O
bogosort	O
)	O
,	O
and	O
then	O
later	O
described	O
by	O
Dick	O
Grune	O
and	O
named	O
gnome	B-Algorithm
sort	I-Algorithm
.	O
</s>
<s>
Gnome	B-Algorithm
sort	I-Algorithm
performs	O
at	O
least	O
as	O
many	O
comparisons	O
as	O
insertion	B-Algorithm
sort	I-Algorithm
and	O
has	O
the	O
same	O
asymptotic	O
run	O
time	O
characteristics	O
.	O
</s>
<s>
Gnome	B-Algorithm
sort	I-Algorithm
works	O
by	O
building	O
a	O
sorted	B-Algorithm
list	I-Algorithm
one	O
element	O
at	O
a	O
time	O
,	O
getting	O
each	O
item	O
to	O
the	O
proper	O
place	O
in	O
a	O
series	O
of	O
swaps	O
.	O
</s>
<s>
Dick	O
Grune	O
described	O
the	O
sorting	B-Algorithm
method	O
with	O
the	O
following	O
story	O
:	O
</s>
<s>
Here	O
is	O
pseudocode	B-Language
for	O
the	O
gnome	B-Algorithm
sort	I-Algorithm
using	O
a	O
zero-based	O
array	B-Data_Structure
:	O
</s>
<s>
Given	O
an	O
unsorted	O
array	B-Data_Structure
,	O
a	O
=	O
[	O
5	O
,	O
3	O
,	O
2	O
,	O
4 ]	O
,	O
the	O
gnome	B-Algorithm
sort	I-Algorithm
takes	O
the	O
following	O
steps	O
during	O
the	O
while	O
loop	O
.	O
</s>
