ANALYSIS OF HOARE FIND ALGORITHM WITH MEDIAN-OF-3 PARTITION

Citation
P. Kirschenhofer et al., ANALYSIS OF HOARE FIND ALGORITHM WITH MEDIAN-OF-3 PARTITION, Random structures & algorithms, 10(1-2), 1997, pp. 143-156
Citations number
13
Categorie Soggetti
Mathematics,Mathematics,Mathematics,"Computer Science Software Graphycs Programming
ISSN journal
10429832
Volume
10
Issue
1-2
Year of publication
1997
Pages
143 - 156
Database
ISI
SICI code
1042-9832(1997)10:1-2<143:AOHFAW>2.0.ZU;2-E
Abstract
Hoare's FIND algorithm can be used to select the jth element out of a file of n elements. It bears a remarkable similarity to Quicksort; in each pass of the algorithm, a pivot element is used to split the file into two subfiles, and recursively the algorithm proceeds with the sub file that contains the sought element. As in Quicksort, different stra tegies for selecting the pivot are reasonable. In this paper, we consi der the Median-of-three version, where the pivot element is chosen as the median of a random sample of three elements. Establishing some hyp ergeometric differential equations, we find explicit formulae for both the average number of passes and comparisons. We compare these result s with the corresponding ones for the basic partition strategy. (C) 19 97 John Wiley & Sons, Inc.