4 research outputs found
A statistical view on exchanges in Quickselect
In this paper we study the number of key exchanges required by Hoare's FIND
algorithm (also called Quickselect) when operating on a uniformly distributed
random permutation and selecting an independent uniformly distributed rank.
After normalization we give a limit theorem where the limit law is a perpetuity
characterized by a recursive distributional equation. To make the limit theorem
usable for statistical methods and statistical experiments we provide an
explicit rate of convergence in the Kolmogorov--Smirnov metric, a numerical
table of the limit law's distribution function and an algorithm for exact
simulation from the limit distribution. We also investigate the limit law's
density. This case study provides a program applicable to other cost measures,
alternative models for the rank selected and more balanced choices of the pivot
element such as median-of- versions of Quickselect as well as further
variations of the algorithm.Comment: Theorem 4.4 revised; accepted for publication in Analytic
Algorithmics and Combinatorics (ANALCO14
The analysis of approximate quickselect and related problems
Approximate Quickselect, a simple modification of the well known Quickselect algorithm for selection, can be used to efficiently find an element with rank k in a given range [i..j], out of n given elements. We study basic cost measures of Approximate Quickselect by computing exact and asymptotic results for the expected number of passes, comparisons and data moves during the execution of this algorithm. The key element appearing in the analysis of Approximate Quickselect is a trivariate recurrence that we solve in full generality. The general solution of the recurrence proves to be very useful, as it allows us to tackle several related problems, besides the analysis that originally motivated us. In particular, we have been able to carry out a precise analysis of the expected number of moves of the ith element when selecting the jth smallest element with standard Quickselect, where we are able to give both exact and asymptotic results. Moreover, we can apply our general results to obtain exact and asymptotic results for several parameters in binary search trees, namely the expected number of common ancestors of the nodes with rank i and j, the expected size of the subtree rooted at the least common ancestor of the nodes with rank i and j, and the expected distance between the nodes of ranks i and j