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.

生成讲解博客的中文版本

生成AI智能校验的中文版本