<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
splaysort	B-Algorithm
is	O
an	O
adaptive	B-Algorithm
comparison	B-Algorithm
sorting	I-Algorithm
algorithm	O
based	O
on	O
the	O
splay	B-Data_Structure
tree	I-Data_Structure
data	B-General_Concept
structure	I-General_Concept
.	O
</s>
<s>
Thus	O
,	O
the	O
algorithm	O
may	O
be	O
seen	O
as	O
a	O
form	O
of	O
insertion	B-Algorithm
sort	I-Algorithm
or	O
tree	B-Algorithm
sort	I-Algorithm
,	O
using	O
a	O
splay	B-Data_Structure
tree	I-Data_Structure
to	O
speed	O
up	O
each	O
insertion	O
.	O
</s>
<s>
Based	O
on	O
the	O
amortized	B-General_Concept
analysis	I-General_Concept
of	O
splay	B-Data_Structure
trees	I-Data_Structure
,	O
the	O
worst	O
case	O
running	O
time	O
of	O
splaysort	B-Algorithm
,	O
on	O
an	O
input	O
with	O
n	O
data	O
items	O
,	O
is	O
O(nlogn )	O
,	O
matching	O
the	O
time	O
bounds	O
for	O
efficient	O
non-adaptive	O
algorithms	O
such	O
as	O
quicksort	B-Algorithm
,	O
heap	B-Application
sort	I-Application
,	O
and	O
merge	B-Algorithm
sort	I-Algorithm
.	O
</s>
<s>
For	O
an	O
input	O
sequence	O
in	O
which	O
most	O
items	O
are	O
placed	O
close	O
to	O
their	O
predecessor	O
in	O
the	O
sorted	O
order	O
,	O
or	O
are	O
out	O
of	O
order	O
with	O
only	O
a	O
small	O
number	O
of	O
other	O
items	O
,	O
splaysort	B-Algorithm
can	O
be	O
faster	O
than	O
O(nlogn )	O
,	O
showing	O
that	O
it	O
is	O
an	O
adaptive	B-Algorithm
sort	I-Algorithm
.	O
</s>
<s>
To	O
quantify	O
this	O
,	O
let	O
dx	O
be	O
the	O
number	O
of	O
positions	O
in	O
the	O
input	O
that	O
separate	O
x	O
from	O
its	O
predecessor	O
,	O
and	O
let	O
ix	O
be	O
the	O
number	O
of	O
items	O
that	O
appear	O
on	O
one	O
side	O
of	O
x	O
in	O
the	O
input	O
and	O
on	O
the	O
other	O
side	O
of	O
x	O
in	O
the	O
output	O
(	O
the	O
number	O
of	O
inversions	B-Algorithm
that	O
involve	O
x	O
)	O
.	O
</s>
<s>
Splaysort	B-Algorithm
can	O
also	O
be	O
shown	O
to	O
be	O
adaptive	B-Algorithm
to	O
the	O
entropy	O
of	O
the	O
input	O
sequence	O
.	O
</s>
<s>
In	O
experiments	O
by	O
,	O
splaysort	B-Algorithm
was	O
slower	O
than	O
quicksort	B-Algorithm
on	O
tables	O
of	O
random	O
numbers	O
by	O
a	O
factor	O
of	O
1.5	O
to	O
2	O
,	O
and	O
slower	O
than	O
mergesort	B-Algorithm
by	O
smaller	O
factors	O
.	O
</s>
<s>
For	O
data	O
consisting	O
of	O
larger	O
records	O
,	O
again	O
in	O
a	O
random	O
order	O
,	O
the	O
additional	O
amount	O
of	O
data	O
movement	O
performed	O
by	O
quicksort	B-Algorithm
significantly	O
slowed	O
it	O
down	O
compared	O
to	O
pointer-based	O
algorithms	O
,	O
and	O
the	O
times	O
for	O
splaysort	B-Algorithm
and	O
mergesort	B-Algorithm
were	O
very	O
close	O
to	O
each	O
other	O
.	O
</s>
<s>
However	O
,	O
for	O
nearly	O
presorted	O
input	O
sequences	O
(	O
measured	O
in	O
terms	O
of	O
the	O
number	O
of	O
contiguous	O
monotone	O
subsequences	O
in	O
the	O
data	O
,	O
the	O
number	O
of	O
inversions	B-Algorithm
,	O
the	O
number	O
of	O
items	O
that	O
must	O
be	O
removed	O
to	O
make	O
a	O
sorted	O
subsequence	O
,	O
or	O
the	O
number	O
of	O
non-contiguous	O
monotone	O
subsequences	O
into	O
which	O
the	O
input	O
can	O
be	O
partitioned	O
)	O
splaysort	B-Algorithm
became	O
significantly	O
more	O
efficient	O
than	O
the	O
other	O
algorithms	O
.	O
</s>
<s>
compared	O
splaysort	B-Algorithm
to	O
several	O
other	O
algorithms	O
that	O
are	O
adaptive	B-Algorithm
to	O
the	O
total	O
number	O
of	O
inversions	B-Algorithm
in	O
the	O
input	O
,	O
as	O
well	O
as	O
to	O
quicksort	B-Algorithm
.	O
</s>
<s>
They	O
found	O
that	O
,	O
on	O
the	O
inputs	O
that	O
had	O
few	O
enough	O
inversions	B-Algorithm
to	O
make	O
an	O
adaptive	B-Algorithm
algorithm	O
faster	O
than	O
quicksort	B-Algorithm
,	O
splaysort	B-Algorithm
was	O
the	O
fastest	O
algorithm	O
.	O
</s>
<s>
modify	O
splaysort	B-Algorithm
to	O
be	O
more	O
strongly	O
adaptive	B-Algorithm
to	O
the	O
number	O
of	O
contiguous	O
monotone	O
subsequences	O
in	O
the	O
input	O
,	O
and	O
report	O
on	O
experiments	O
showing	O
that	O
the	O
resulting	O
algorithm	O
is	O
faster	O
on	O
inputs	O
that	O
are	O
nearly	O
presorted	O
according	O
to	O
this	O
measure	O
.	O
</s>
