Can I get help to give an analysis of the running time Big-O? I'm not sure if all my answers are correct.
I got for a) $ O(n)$, b) $O(n^3)$, c) $O(n^{1/2})$ and d) $O(log(n))$
(a)
sum=0;
for ( i =0; i<n ; i +=10)
sum++;
(b)
sum=0;
for ( i =0; i<n*n;++ i )
for ( j =n ; j >0;--j )
++sum;
(c)
sum=0;
for ( i =0 , j =n ; i<j ;++ i , j --)
++sum;
(d)
int function (long n){
int sum = 0 ;
for (;n>0;n/=2){
sum+=n%2;
}
return sum;
}