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

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.