English

Upper Bounds for In-Place Sorting with Minimal Moves

Data Structures and Algorithms 2026-07-29 v1

Abstract

We present the first in-place comparison-based sorting algorithm that sorts an array of nn elements using nlgn+O(n)n\lg n + O(n) comparisons with exponentially high probability and always O(n)O(n) 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 nlgn+O(nlg(t)n)n\lg n + O(n\lg^{(t)}n) comparisons and O(tn)O(tn) data moves, where tt is an integer parameter satisfying 2tlgn12 \leq t \leq \lg^{*}n - 1 and lg(t)n\lg^{(t)}n denotes the tt-time iterated logarithm, improving over the previous upper bound of nlgn+O(nlglgn)n\lg n + O(n\lg\lg n) comparisons and O(n)O(n) moves when using constant t>2t>2. 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 lgn+O(1)\lg n + O(1) comparisons for nn elements.

Cite

@article{arxiv.2607.27040,
  title  = {Upper Bounds for In-Place Sorting with Minimal Moves},
  author = {Alex Zihan Xu and Stephen Jing Chick},
  journal= {arXiv preprint arXiv:2607.27040},
  year   = {2026}
}

Comments

30 pages, 10 pages main text, 18 pages appendix