A case study in comparison based complexity: Finding the nearest value(s)
It is shown that 5n/4 plus-minus lower order terms comparisons on average are necessary and sufficient to solve the problem of finding the values of ranks immediately above and below a specified element x in a set X of size n>1. When x turns out to be the median of X, 1.5n+√πn/8+O(lg n) comparisons are proven to be sufficient. n+min(k, n−k)+3 ln n+O(1) comparisons are sufficient if k, the rank of x in X, differs from n/2 by Θ(n).
KeywordsAverage Cost Close Neighbor Close Comparison Neighbor Problem Current Neighbor
Unable to display preview. Download preview PDF.
- 1.M. Blum, R.W. Floyd, V.R. Pratt, R.L. Rivest and R.E. Tarjan, Time Bounds for Selection, J. Compt. and Sys. Sci., 7, 1973, pp. 448–461.Google Scholar
- 2.W. Cunto and J.I. Munro, Closest Neighbor Problem, Proceedings 22-nd Allerton Conference, Urbana, Illinois, 1984, pp. 510–515.Google Scholar
- 3.W. Cunto and J.I. Munro, Average Case Selection, JACM, 36, 1989, pp. 270–279.Google Scholar
- 4.R.W. Floyd and R.L. Rivest, Expected Time Bounds for Selection, CACM, 18, 1975, pp. 165–172.Google Scholar
- 5.R.W. Floyd and R.L. Rivest, Algorithm 489: The Algorithm SELECT for Finding the ith Smallest of n elements, CACM, 18, 1975, pp. 173.Google Scholar