<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
the	O
Floyd-Rivest	B-Algorithm
algorithm	I-Algorithm
is	O
a	O
selection	B-Algorithm
algorithm	I-Algorithm
developed	O
by	O
Robert	O
W	O
.	O
Floyd	O
and	O
Ronald	O
L	O
.	O
Rivest	O
that	O
has	O
an	O
optimal	O
expected	O
number	O
of	O
comparisons	O
within	O
lower-order	O
terms	O
.	O
</s>
<s>
It	O
is	O
functionally	O
equivalent	O
to	O
quickselect	B-Algorithm
,	O
but	O
runs	O
faster	O
in	O
practice	O
on	O
average	O
.	O
</s>
<s>
The	O
algorithm	O
was	O
originally	O
presented	O
in	O
a	O
Stanford	O
University	O
technical	O
report	O
containing	O
two	O
papers	O
,	O
where	O
it	O
was	O
referred	O
to	O
as	O
SELECT	O
and	O
paired	O
with	O
PICK	O
,	O
or	O
median	B-Algorithm
of	I-Algorithm
medians	I-Algorithm
.	O
</s>
<s>
The	O
Floyd-Rivest	B-Algorithm
algorithm	I-Algorithm
is	O
a	O
divide	B-Algorithm
and	I-Algorithm
conquer	I-Algorithm
algorithm	I-Algorithm
,	O
sharing	O
many	O
similarities	O
with	O
quickselect	B-Algorithm
.	O
</s>
<s>
The	O
following	O
pseudocode	B-Language
rearranges	O
the	O
elements	O
between	O
left	O
and	O
right	O
,	O
such	O
that	O
for	O
some	O
value	O
k	O
,	O
where	O
left	O
≤	O
k	O
≤	O
right	O
,	O
the	O
kth	O
element	O
in	O
the	O
list	O
will	O
contain	O
the	O
(	O
k	O
−	O
left	O
+	O
1	O
)	O
th	O
smallest	O
value	O
,	O
with	O
the	O
ith	O
element	O
being	O
less	O
than	O
or	O
equal	O
to	O
the	O
kth	O
for	O
all	O
left	O
≤	O
i	O
≤	O
k	O
and	O
the	O
jth	O
element	O
being	O
larger	O
or	O
equal	O
to	O
for	O
k	O
≤	O
j	O
≤	O
right	O
:	O
</s>
