calculate the complexity of the below recursive code
Int f(int n)
{
If(n
return 1;
return f(n/2)+f(n/2);
}
Here the function is recursively calling on f(n/2) twice and also one line for the condition when n=0. Hence 1 is the correct choice.
Please Register/Login to Download Question