Calculation of Running time of array when size increase by constant

18 Views Asked by At

I am learning data structure and running time calculation. I got a problem to understand the running time calculation of increasing the size of the array.

1) if we increase the size of the array by constant.
$ N=4$ will be $ N_o$
$ N=8$ will be $ N_o+c$
$ N=12$ will be $ N_o+2c$
$ N_o+kc$
$N=N_0+kc$
$ k=(N-N_o)/c$
Running time= $N_ok+c(1+2+ , ... , k)$
$N_ok+ck(k+1)/2$
$O(N^2)$

Anyone please help me to understand the final calculation of running time.