If I use the gap from shell with always lowering gap=n/2 how can I simply get the math behind the complexity. I know and read all other questions here but it doesn't seem obvious to me.
What I got until now:
For shell (every gap before 1, so before insertion sort starts) we have is
n/2, n/4, n/8,..., 1
and for insertion sort we have
n^2
This together means:
n^2+(n^2)/2 + (n^2)/4 + ,..., + 2n^2
So this together means I have a worst-case of O(n^2)?
Is that correct so far?
How can I prove that?