Consider the following C function.
int func(int n)
{
int i , j , k , p , q=1;
for(i=1 ; i<= n ; i++)
{
p=0;
for(k=1 ; k<= n ; k<<=1)
p++;
for(j=p ; j>= 1 ; j>>=1);
q=q<<=1;
}
return q;
}
Which one of the following is the approximate value returned by the above function?
- $\Theta(n)$
- $\Theta(2^n)$
- $\Theta(2^{(n \log n))}$
- $\Theta(\log n)$