CODE:
void fun(int n){ if(n>2){ for(int i=0;i<n;i++){ j=0; while(j<n){ cout<<j; j++; } } fun(n/2); } } Here's what I think: The recursive part is running log(n) times ? and during each recursive call, the for loop will run n^2 times, with n changing to half in each recursive call. So is it n^2 + (n^2)/4 + (n^2)/16 + ... + 1?