1

What is the worst case for Shell Sort? I think worst case is an ordered set with the largest values in odd positions: $$ 1,4,2, 16,8, ...$$

With $O(n(log$ ${n)}^2)$ complexity or $O(n^2)$? Actually, I think that the former one is correct as opposed to here in which it is claimed that the worst case is of Gap Sequences with complexity of $\Theta(n^2)$.

David
  • 153

0 Answers0