In this paper, we present a practical Quicksort-based sorting algorithm that exhibits the following properties: (1) O(n(log n)2) worst case; (2) the expected number of comparisons is equal to the information-theoretic lower bound; and (3) the expected number of data interchanges is slightly higher than that of Quicksort. Considering the worst-case complexity, the average-case complexity and the simplicity of the algorithm, we claim that this algorithm is so far the most practical alternative to Quicksort. This is particularly true when one is not willing to take the risk of the worst case occuring when running Quicksort.
KeywordsSamplesort Quicksort Leapfrogging Samplesort sorting analysis of algorithms
Unable to display preview. Download preview PDF.
- 1.Albacea, E.A., Leapfrogging samplesort and its improvements, ICS-UPLB Technical Report #95-2, Institute of Computer Science, University of the Philippines Los Baños, 1995.Google Scholar
- 2.Apers, P.M.G., Recursive samplesort, BIT 18 (1978), 125–132.Google Scholar
- 3.Davidson, C.M., Quicksort revisited, IEEE Transactions on Software Engineering 14(1988), 1480.Google Scholar
- 4.Frazer, W.D. and McKellar, A.C., Samplesort: A sampling approach to minimal storage tree sorting, J. ACM 17 (1970), 496–507.Google Scholar
- 5.Gonnet, G.H. and Baeza-Yates, R Handbook of Algorithms and Data Structures: In Pascal and C (2nd Ed) (Addison-Wesley, 1991).Google Scholar
- 6.Hoare, C.A.R., Partition: Algorithm 63; Quicksort: Algorithm 64; and Find: Algorithm 65, Communications of the ACM 4 (1961), 321–322.Google Scholar
- 7.Hoare, C.A.R., Quicksort, Computer Journal 5 (1962), 10–15.Google Scholar
- 8.Knuth, D.E., The Art of Computer Programming, Vol 3: Sorting and Searching (Addison-Wesley, Mass., 1973).Google Scholar
- 9.Peters, J.G., and Kritzinger, P.S., Implementation of samplesort: a minimal storage tree sort, BIT 15 (1975), 85–93.Google Scholar
- 10.Rohrich, A hybrid of Quicksort with O(n log n) worst-case complexity, Information Processing Letters 14 (1982).Google Scholar
- 11.Sedgewick, R., Quicksort (Garland, N.Y., 1978).Google Scholar
- 12.Sedgewick, R., Implementing Quicksort programs, Communications of the ACM 21 (1978), 847–857.Google Scholar
- 13.Wainwright, A class of sorting algorithms based on Quicksort, Communications of the ACM 28 (1985).Google Scholar