Table of Contents
Fetching ...

QR Sort: A Novel Non-Comparative Sorting Algorithm

Randolph T. Bushman, Tanya M. Tebcherani, Alhassan S. Yasin

TL;DR

The results reveal that QR Sort frequently outperforms established algorithms and serves as a reliable sorting algorithm for input sequences that exhibit large $m$ relative to $n$, showcasing its adaptability.

Abstract

In this paper, we introduce and prove QR Sort, a novel non-comparative integer sorting algorithm. This algorithm uses principles derived from the Quotient-Remainder Theorem and Counting Sort subroutines to sort input sequences stably. QR Sort exhibits the general time and space complexity $\mathcal{O}(n+d+\frac{m}{d})$, where $n$ denotes the input sequence length, $d$ denotes a predetermined positive integer, and $m$ denotes the range of input sequence values plus 1. Setting $d = \sqrt{m}$ minimizes time and space to $\mathcal{O}(n + \sqrt{m})$, resulting in linear time and space $\mathcal{O}(n)$ when $m \leq \mathcal{O}(n^2)$. We provide implementation optimizations for minimizing the time and space complexity, runtime, and number of computations expended by QR Sort, showcasing its adaptability. Our results reveal that QR Sort frequently outperforms established algorithms and serves as a reliable sorting algorithm for input sequences that exhibit large $m$ relative to $n$.

QR Sort: A Novel Non-Comparative Sorting Algorithm

TL;DR

The results reveal that QR Sort frequently outperforms established algorithms and serves as a reliable sorting algorithm for input sequences that exhibit large relative to , showcasing its adaptability.

Abstract

In this paper, we introduce and prove QR Sort, a novel non-comparative integer sorting algorithm. This algorithm uses principles derived from the Quotient-Remainder Theorem and Counting Sort subroutines to sort input sequences stably. QR Sort exhibits the general time and space complexity , where denotes the input sequence length, denotes a predetermined positive integer, and denotes the range of input sequence values plus 1. Setting minimizes time and space to , resulting in linear time and space when . We provide implementation optimizations for minimizing the time and space complexity, runtime, and number of computations expended by QR Sort, showcasing its adaptability. Our results reveal that QR Sort frequently outperforms established algorithms and serves as a reliable sorting algorithm for input sequences that exhibit large relative to .

Paper Structure

This paper contains 19 sections, 5 theorems, 13 equations, 4 figures, 2 tables.

Key Result

lemma 1

Let $S$ denote a sequence of integers, and for each $s_i$ in $S$, define the remainder $r_i$ and quotient $q_i$ using Eqs. equation_k_r and equation_k_q, where $d$ denotes some positive integer divisor. If $s_i < s_j$ and $r_i \geq r_j$, then $q_i < q_j$.

Figures (4)

  • Figure 1: Visualization of the sorting procedure of the QR Sort Algorithm given an integer array input with length $n = 8$. For the divisor $d$, we selected the optimal divisor described in Proposition \ref{['OptimalDivisorTheorem_RQ']}, or $d = \sqrt{m} = \sqrt{73-0+1} = 8$.
  • Figure 2: Visualization of the sorting procedure of the Counting Sort algorithm given an integer array input of size $n = 8$ and a range of $7$ ($m = 8$).
  • Figure 3: Block diagram of one SortTester_C experiment used to evaluate the performance of multiple sorting algorithms in terms of computational units (CU).
  • Figure 4: Computational units expended by Merge Sort, Quicksort, Counting Sort, Radix Sort, and QR Sort for four SortTester_C experiments using input integer arrays $A$ with varying element ranges $m$ ($m = max(A) - min(A) + 1$). For Radix Sort, we set the base of the number system $b$ equals the input array length $n$. (a) $m = 50,000$. QR Sort expended fewer computational units than Merge Sort, Quicksort, and Radix Sort. Counting Sort expended the least computational units compared to all other sorting algorithms. (b) $m = 500,000$. QR Sort expended fewer computational units than Merge Sort, Quicksort, and Radix Sort. Counting Sort generally expended the least computational units compared to all other sorting algorithms. (c) $m = 5,000,000$. QR Sort expended fewer computational units than Merge Sort, Quicksort, and Radix Sort. Counting Sort expended the least computational units compared to all other sorting algorithms when $n \geq 370,000$. QR Sort expended the least computational units compared to all other sorting algorithms when $n < 370,000$. (d) $m = 50,000,000$. QR Sort expended fewer computational units than all other sorting algorithms.

Theorems & Definitions (11)

  • lemma 1
  • proof
  • definition 1
  • theorem 1
  • proof
  • theorem 2
  • proof
  • proposition 1
  • proof
  • corollary 1
  • ...and 1 more