Search arXiv⌕ Search

arXiv · 0706.4107

Radix Sorting With No Extra Space

Abstract

It is well known that n integers in the range [1,n^c] can be sorted in O(n) time in the RAM model using radix sorting. More generally, integers in any range [1,U] can be sorted in O(n sqrt{loglog n}) time. However, these algorithms use O(n) words of extra memory. Is this necessary? We present a simple, stable, integer sorting algorithm for words of size O(log n), which works in O(n) time and uses only O(1) words of extra memory on a RAM model. This is the integer sorting case most useful in practice. We extend this result with same bounds to the case when the keys are read-only, which is of theoretical interest. Another interesting question is the case of arbitrary c. Here we present a black-box transformation from any RAM sorting algorithm to a sorting algorithm which uses only O(1) extra space and has the same running time. This settles the complexity of in-place sorting in terms of the complexity of sorting.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Gianni Franceschini, S. Muthukrishnan, Mihai Patrascu. 2007-06-27. Radix Sorting With No Extra Space. https://arxiv.org/abs/0706.4107

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Computational complexity of the recoverable robust shortest path problem in acyclic digraphs under interval budgeted uncertainty

In this paper, we consider the recoverable robust shortest path problem in acyclic digraphs, employing interval budgeted uncertainty to model uncertain second-stage costs. For the continuous budgeted uncertainty model, we prove that the problem is strongly NP-hard even in layered digraphs. Furthermore, we show that in general acyclic digraphs, the problem cannot be approximated within any constant factor unless $\mathrm{P} = \mathrm{NP}$, nor can it be approximated within a factor of $2^{\log^{1-ε} n}$ for any $ε> 0$ unless $\mathrm{NP} \subseteq \mathrm{DTIME}(n^{\mathrm{poly} \log n})$. For the discrete budgeted uncertainty model, we show that the problem is not approximable unless $\mathrm{P} = \mathrm{NP}$, even in layered digraphs. Finally, we establish that under continuous budgeted uncertainty, the integrality gap of a relaxation allowing a fractional first-stage solution is at least $Ω(\sqrt{n})$.

cs.DS↗

Odd and Even Harder Problems on Cycle-Factors

For a graph (undirected or directed), a cycle-factor is a collection of vertex-disjoint cycles covering the entire vertex set. Cycle-factors subject to parity constraints arise naturally in the study of structural graph theory and algorithmic complexity. In this work, we study four variants of the problem of finding a cycle-factor subject to the following parity constraints: (1) all cycles are odd, (2) all cycles are even, (3) at least one cycle is odd, and (4) at least one cycle is even. We show that all the variants of the problem are NP-complete both in undirected and directed graphs, even if each vertex is incident to at most three edges. We also prove that the first two variants are NP-complete even for planar directed graphs.

cs.DS↗

An $n^{8/5+o(1)}$-Time $Ω(λ^3)$-Approximation for Longest Common Subsequence

Let $λ$ denote the ratio of the length of a longest common subsequence of two length-$n$ strings to $n$. Rubinstein, Seddighin, Song and Sun [RSSS19] gave an $Ω(λ^3)$-approximation for LCS running in $\widetilde O(n^{39/20})$ time, where $39/20=1.95$. Song [Son19] mentioned that improving the $n^{1.95}$ running time is an interesting open question. We give an algorithm that computes an $Ω(λ^3)$-approximation of the longest common subsequence in $n^{8/5+o(1)}$ time. This improves the exponent $1.95$ to $1.6+o(1)$.

cs.DS↗