Skip to content

Shellsort with O(n n) Average-Case Complexity

Cheng Du, Zongqi Wan

cs.DSarXiv:2611.27671

Abstract

We show that Shellsort admits a fixed sequence of O( n) gaps that sorts a uniform random permutation in O(n n) expected comparisons. In fact, we give a distribution on decreasing gap sequences with this expected bound for every fixed input. We also give a randomized polynomial-time algorithm that, with high probability, constructs a sequence attaining the average-case bound.

Create a lesson