We show below that the randomized Shellsort, as described
in Section 2, will polylog(n)-near-sort an input array
A, with very high probability, for some constant > 0.
We can then use Pratt’s version [36] of (deterministic) Shellsort
as a 2 polylog(n)-sorter, S, in a S-shaker postprocessing
pass over A, which will run in O(n(log log n)2) time and
(by Lemma 2.1) will complete the sorting of A. Note, in addition,
that since we are using a Shellsort implementation in
an S-shaker (Shellsort-type) pass, adding this postprocessing
phase to our randomized Shellsort algorithm keeps the
entire algorithm being a data-oblivious variant of the Shellsort
algorithm.