An Explicit and Efficient O(n2)-Time Algorithm for Sorting Sumsets

Abstract

We present the first explicit comparison-based algorithm that sorts the sumset X + Y = \xi + yj,\ ∀ 0 i, j < n\, where X and Y are sorted arrays of real numbers, in optimal O(n2) time and comparisons. While Fredman (1976) proved the theoretical existence of such an algorithm, a concrete construction has remained open for nearly five decades. Our algorithm exploits the structured monotonicity of the sumset matrix to perform amortized constant-comparisons and insertions, eliminating the (n) overhead typical of comparison-based sorting. We prove correctness and optimality in the standard comparison model, extend the method to k-fold sumsets with O(nk) performance, and outline potential support for dynamic updates. Experimental benchmarks show significant speedups over classical algorithms such as MergeSort and QuickSort when applied to sumsets. These results resolve a longstanding open problem in sorting theory and contribute novel techniques for exploiting input structure in algorithm design.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…