Abstract
In this paper, we present an engineered sorting algorithm, named NQQuicksort, which is efficient and non quadratic. To avoid the quadratic worst case, and degenerate partitioning performance, NQQuicksort adopts two pivot computations only. The first is the same as the pivot computation in median of three quicksort and the second is similar to that in binary quicksort (radix exchange). The pivot computations applied are quite different and non-related, such that when one pivot computation fails, it gives no indication to whether the second pivot computation step will, or will not succeed (fail). When the first pivot selected results in unbalanced partitioning, the second pivot computation is immediately applied in the next recursive call. NQQuickSort is faster than the tuned quicksort implementation of the Java class library engineered by Bentley and McIlroy [3]. The algorithm and its runtime behavior are discussed in detail. The performance of NQQuicksort is faster than quicksort as well as the fastest variant of radix sorting algorithms; the Least Significant Digit (LSD) radix sort [15].
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Aho, A., Hopcroft, J., Ullman, J.: The Design and Analysis of Computer Algorithms. Addison-Wesley, Reading (1974)
Anderson, A., Nilsson, S.: Implementing Radixsort. ACM Journal of Experimental Algorithmics 3(7) (1998)
Bentley, J.L., McIlroy, M.D.: Engineering a Sort Function. Software Practice and Experience 23(11), 1249–1265 (1993)
Bhutoria, S., Konjevod, G.: Quickening Quick-Sort. In: REAS 2003 (2003)
Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn., pp. 145–164. MIT Press, McGraw-Hill (2001) ISBN 0-262-03293-7
Dean, B.C.: A Simple Expected Running Time Analysis for Randomized ’Divide and Conquer’ Algorithms. Discrete Applied Mathematics 154(1), 1–5 (2006)
Dobosiewicz, W.: Sorting by Distributive Partition. Information Processing Letters 7(1), 1–6 (1978)
Hildebrandt, P., Isbitz, H., Mehlhorn, K.: Radix Exchange- An Internal Sorting Method for digital computers. JACM 6, 156–163 (1959)
Hoare, C.A.R.: ”Partition: Algorithm 63,” ”Quicksort: Algorithm 64,” and ”Find: Algorithm 65”. Comm. ACM 4(7), 321–322 (1961)
Hoare, C.A.R.: Quicksort. Computer Journal 5(1), 10–15 (1962) (reprinted in Hoare and Jones: Essays in computing science, 1989)
Knuth, D.E.: The Art of Computer Programming, 2nd edn., vol. 3, pp. 113–122. Addison-Wesley, Reading (1973) ISBN 0-201-89685-0
LaMarca, A., Ladner, R.E.: The Influence of Caches on the Performance of Sorting. In: Proceedings of the Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 370–379 (1997)
Lau, K.K.: Top-Down Synthesis of Sorting Algorithms. The Computer Journal 35, A001–A007 (1992)
Martnez, C., Roura, S.: Optimal sampling strategies in quicksort and quickselect. SIAM J. Computing 31(3), 683–705 (2001)
Maus, A.: ARL: A Faster In-place, Cache Friendly Sorting Algorithm. In: Norsk Informatikkonferranse NIK 2002, pp. 85–95 (2002)
McIlroy, P., Bostic, K., McIlroy, M.: Engineering Radix Sort. Computer Systems 6(1), 5–27 (1993)
Douglas McIlroy, M.: A Killer Adversary for Quicksort. Software Practice and Experience 29(0), 1–4 (1999)
Mehlhorn, K.: Data Structures and Algorithms 1: Sorting and Searching. Springer, Heidelberg (1984)
Musser, D.R.: Introspective Sorting and Selection Algorithms. Software Practice and Experience 27(8), 983–993 (1997)
Sedgewick, R.: Implementing Quicksort programs. Communications of the ACM 21(10), 847–857 (1978)
Sedgewick, R.: Algorithms in Java, Parts 1-4, 3rd edn., pp. 1–4. Addison-Wesley, Reading (2003)
Sedgewick, R., Flajolet, P.: An Introduction to the Analysis of Algorithms. Addison-Wesley, Reading (1996)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Daoud, A.M., Abdel-jaber, H., Ababneh, J. (2011). Efficient Non-Quadratic Quick Sort (NQQuickSort). In: Ariwa, E., El-Qawasmeh, E. (eds) Digital Enterprise and Information Systems. DEIS 2011. Communications in Computer and Information Science, vol 194. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22603-8_58
Download citation
DOI: https://doi.org/10.1007/978-3-642-22603-8_58
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-22602-1
Online ISBN: 978-3-642-22603-8
eBook Packages: Computer ScienceComputer Science (R0)