Increasing the Efficiency of Quicksort
A method is presented for the analysis of various generalzotions of quicksort. The average asymptotic number of comparisons needed is shown to be ozn log2 (n). A formula is derived expressing of in terms of the probability distribution of the “bound” of a partition. This formula assumes a partcdarly simple form for a generalization already considered by Hoare, namely, choice of the bound as median of a random sample. The main contribution of this paper is another generaization of quicksort, which uses a bounding interval instead of a single element as bound. This generalization turns out to be easy to implement in a computer program. A numerical approximation shows that a = 1.140 for this version of qvicksort compared with 1.386 for the original. This implies a decrease in number of comparisons of 18 percent; actual tests showed about 15 percent saving in computing time.