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.
Statement : During a one day match, Australian fielder Labuschagne was observed not obeying one of the many recent changes implemented by the ICC, the ...
Statement: A 16-year-old boy drowned in a lake when he went for a swim along with his friends.
Courses of actions:
I. Coaching ...
Statement: Although the tribal women are familiar with beekeeping, their conventional method does not guarantee adequate returns.
Cours...
Statement: A dentist of Hospital DBX situated in town X of the population nearly 1 lac is giving a test prescription unnecessarily. This test is also ...
Statement : According to the latest issue of the medical journal Lancet, Multidrug Resistant-Tuberculosis (MDR-TB), a version of the disease where pat...
Statement: As per a report, more than 2 crore cases are pending in India’s district courts
Courses of actions:
I . Beyond t...
Statement : According to the latest issue of the medical journal Lancet, Multidrug Resistant-Tuberculosis (MDR-TB), a version of the disease where pat...
Statement: Malnutrition isn’t just about acute starvation and often, healthy-looking people are malnourished too, because their diet does not inclu...
Statement: Employee Y of a company is trying to defame the image of employee X of the same company by making false allegations about him to his manag...
Statement: Although the tribal women are familiar with beekeeping, their conventional method does not guarantee adequate returns.
Cours...