Skip to main content

Efficient Non-Quadratic Quick Sort (NQQuickSort)

  • Conference paper

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 194))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aho, A., Hopcroft, J., Ullman, J.: The Design and Analysis of Computer Algorithms. Addison-Wesley, Reading (1974)

    MATH  Google Scholar 

  2. Anderson, A., Nilsson, S.: Implementing Radixsort. ACM Journal of Experimental Algorithmics 3(7) (1998)

    Google Scholar 

  3. Bentley, J.L., McIlroy, M.D.: Engineering a Sort Function. Software Practice and Experience 23(11), 1249–1265 (1993)

    Article  Google Scholar 

  4. Bhutoria, S., Konjevod, G.: Quickening Quick-Sort. In: REAS 2003 (2003)

    Google Scholar 

  5. 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

    Google Scholar 

  6. Dean, B.C.: A Simple Expected Running Time Analysis for Randomized ’Divide and Conquer’ Algorithms. Discrete Applied Mathematics 154(1), 1–5 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  7. Dobosiewicz, W.: Sorting by Distributive Partition. Information Processing Letters 7(1), 1–6 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  8. Hildebrandt, P., Isbitz, H., Mehlhorn, K.: Radix Exchange- An Internal Sorting Method for digital computers. JACM 6, 156–163 (1959)

    Article  MathSciNet  MATH  Google Scholar 

  9. Hoare, C.A.R.: ”Partition: Algorithm 63,” ”Quicksort: Algorithm 64,” and ”Find: Algorithm 65”. Comm. ACM 4(7), 321–322 (1961)

    Article  Google Scholar 

  10. Hoare, C.A.R.: Quicksort. Computer Journal 5(1), 10–15 (1962) (reprinted in Hoare and Jones: Essays in computing science, 1989)

    Article  MathSciNet  MATH  Google Scholar 

  11. Knuth, D.E.: The Art of Computer Programming, 2nd edn., vol. 3, pp. 113–122. Addison-Wesley, Reading (1973) ISBN 0-201-89685-0

    Google Scholar 

  12. 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)

    Google Scholar 

  13. Lau, K.K.: Top-Down Synthesis of Sorting Algorithms. The Computer Journal 35, A001–A007 (1992)

    Article  Google Scholar 

  14. Martnez, C., Roura, S.: Optimal sampling strategies in quicksort and quickselect. SIAM J. Computing 31(3), 683–705 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  15. Maus, A.: ARL: A Faster In-place, Cache Friendly Sorting Algorithm. In: Norsk Informatikkonferranse NIK 2002, pp. 85–95 (2002)

    Google Scholar 

  16. McIlroy, P., Bostic, K., McIlroy, M.: Engineering Radix Sort. Computer Systems 6(1), 5–27 (1993)

    Google Scholar 

  17. Douglas McIlroy, M.: A Killer Adversary for Quicksort. Software Practice and Experience 29(0), 1–4 (1999)

    Google Scholar 

  18. Mehlhorn, K.: Data Structures and Algorithms 1: Sorting and Searching. Springer, Heidelberg (1984)

    Book  MATH  Google Scholar 

  19. Musser, D.R.: Introspective Sorting and Selection Algorithms. Software Practice and Experience 27(8), 983–993 (1997)

    Article  Google Scholar 

  20. Sedgewick, R.: Implementing Quicksort programs. Communications of the ACM 21(10), 847–857 (1978)

    Article  MATH  Google Scholar 

  21. Sedgewick, R.: Algorithms in Java, Parts 1-4, 3rd edn., pp. 1–4. Addison-Wesley, Reading (2003)

    Google Scholar 

  22. Sedgewick, R., Flajolet, P.: An Introduction to the Analysis of Algorithms. Addison-Wesley, Reading (1996)

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics