1
int R(int n)
{
    if(n<=1)
        return 1;
    else 
    {
        int sum=0;
        for(int i=1;i<=n;i=i*2)
        for(j=1;j<=i;j=j*2){
            sum=sum+i;
            sum=sum*R(n/2);
        }
    }
    return sum;
}

I try to explain


T(1) = 1

T(2) = 2

T(4) = 6

T(8) = 36

T(16) = 360

T(32) = 5400

so, the growth rate is higher than that of $n^2$.

Raphael
  • 72,336
  • 29
  • 179
  • 389
Mithlesh Upadhyay
  • 475
  • 3
  • 12
  • 31

0 Answers0