732 views
2 votes
2 votes
int f(int x)
{
if(x<1) return 1;
else return statement;
}
int g(int x)
{
if(x<2) return 1;
else return f(x-1) +g(x/2);
}

If statement=f(x-1) +g(x/2) then it grows quadratically

But if statement=f(x-1)+g(x) then it grows exponentially

What is the difference b/w the two.

How to identify that it is growing quadratically and other is growing exponentially???

Could u also explain a variation in which it will grow logarithmically?

Please log in or register to answer this question.

Related questions

0 votes
0 votes
3 answers
1
gshivam63 asked May 19, 2016
2,920 views
int f(int x){if(x<1) return 1;else return f(x-1) +g(x/2);}int g(int x){if(x<2) return 1;else return f(x-1) +g(x/2);}a. LogarithmicB. QuadraticC. LinearD. Exponential
0 votes
0 votes
2 answers
4
moustafa asked Mar 9, 2023
2,157 views
1. Express the following function as a sum of minterms: F(A, B, C, D) = B'D+A'D + BD