next up previous
Next: About this document ... Up: sorting Previous: LOWER BOUND

SHELL SORT (Donald Shell)

Sorted
$h_{1}=1$ always use insertion sort for sorting
with $h_{2}=1.72n^{1/3}$
$W(n)=(\frac{n}{1.72n^{1/3}})^{2}+1.72n^{1/3}+n^{2}$
$=\frac{n^{2}}{1.72n^{1/3}}+n^{2}$
$=\frac{n^{5/3}}{1.72}+n^{2}$
$=O(n^{2})$

for $h_{k}=2^{k}-1$, $1\leq k\leq \lfloor\log n\rfloor$
$2^{5}-1=31=(11111)_{2}$
$2^{4}-1=15=(1111)_{2}$
for $h_{k}$ is an integer of the form $2^{i}3^{j},h_{k}<n$
$W(n)=O(n(\log n)^{2})$
$2^{0}3^{0},2^{1}3^{0},2^{0}3^{1},2^{1}3^{1},2^{2}3^{1}$
1 2 3 6 12
too many $h_{k}'$s, hence overhead is large.


Sushil_Prasad 2014-09-25