algorithms

Upper Bounds for In-Place Sorting with Minimal Moves

arXiv:2607.27040

summary

The paper introduces an in-place comparison‑based sorting algorithm that uses only O(n) element moves while achieving n·log n + O(n) comparisons with high probability, and provides a worst‑case variant with tunable trade‑offs using iterated logarithms.

Abstract

We present the first in-place comparison-based sorting algorithm that sorts an array of elements using comparisons with exponentially high probability and always moves. This matches the information-theoretic lower bound up to an additive linear term despite making only linear moves and working in-place. For the worst-case, we present an algorithm that makes comparisons and data moves, where is an integer parameter satisfying and denotes the -time iterated logarithm, improving over the previous upper bound of comparisons and moves when using constant . We thus achieve the ultimate goal of minimal move in-place sorting via randomization whilst narrowing the gap to this goal in the worst-case. This advance primarily relies on a novel ordered set structure that supports searches in an optimal comparisons for elements.

30 pages, 10 pages main text, 18 pages appendix

Topics & keywords

#in-place sorting#comparison-based sorting#minimal moves#randomized algorithms#worst-case analysisin-place sortingcomparison complexitymove complexityiterated logarithmordered set data structurerandomized algorithm