void fun(int a[],int n)

{

int j,i,k,m,mid;

for(m = n/2;m>0;m/=2)

for(j = m;j=0;i-=m){

if(a[i+m]>=a[i])

break;

else{

mid = a[i];

a[i] = a[i+m];

a[i+m] = mid;

}

}

}

What is the worst case complexity of above code?

A) Θ(n^3)

B) Θ(n^2)

C) Θ(n^1.5)

D) Θ(n*lg(n))

Answer(C)

### Question stats

Question and answer is powered by AnsPress