Affiliation:
1. Stanford Univ., Standford, CA
2. Massachusetts Institute of Technology, Cambridge
Abstract
SELECT
will rearrange the values of array segment
X
[
L
:
R
] so that
X
[
K
] (for some given
K
;
L
≤
K
≤
R
) will contain the (
K
-
L
+1)-th smallest value,
L
≤
I
≤
K
will imply
X
[
I
] ≤
X
[
K
], and
K
≤
I
≤
R
will imply
X
[
I
] ≥
X
[
K
. While
SELECT
is thus functionally equivalent to Hoare's algorithm
FIND
[1], it is significantly faster on the average due to the effective use of sampling to determine the element
T
about which to partition
X
. The average time over 25 trials required by
SELECT
and
FIND
to determine the median of
n
elements was found experimentally to be:
n
500 1000 5000 10000
SELECT
89 ms. 141 ms. 493 ms. 877 ms.
FIND
104 ms. 197 ms. 1029 ms. 1964 ms. The arbitrary constants 600, .5, and .5 appearing in the algorithm minimize execution time on the particular machine used.
SELECT
has been shown to run in time asymptotically proportional to
N
+ min (
I
,
N
-
I
), where
N
=
L
-
R
+ 1 and
I
=
K
-
L
+ 1. A lower bound on the running time within 9 percent of this value has also been proved [2]. Sites [3] has proved
SELECT
terminates.
Publisher
Association for Computing Machinery (ACM)
Reference3 articles.
1. Algorithm 63: partition
2. Sites Richard. Some thoughts on proving clean termination of programs. Stanford CSD Rep. 417 May 1974. Sites Richard. Some thoughts on proving clean termination of programs. Stanford CSD Rep. 417 May 1974.
Cited by
38 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献