384 views
1 votes
1 votes
Consider the following C code:

int f(int x){

if(x<1) return 1;

else return f(x-1)+g(x);

}

int g(int x){

if(x<2) return 1;

else return f(x-1)+g(x/2);

}

Of the following, which best describes the growth of f(x) as a function of x?

a) logarithmic

b) quadratic

c) linear

d) exponential

please explain.

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
2
0 votes
0 votes
1 answer
3
NeelParekh asked Jul 27, 2023
263 views
If an array is split in the form of increasing and decreasing order then what is TC to find minimum element in the array?
2 votes
2 votes
1 answer
4
h4kr asked Dec 30, 2022
433 views
What is the correct time complexity in $\theta()$ ?