Consider the following C function:
double foo (int n)
{
int i;
double sum;
if (n == 0) return 1.0;
else
{
sum = 0.0;
for (i = 0; i < n; i++)
sum += foo (i);
return sum;
}
}
The space complexity of the above function is:
- AO(1)
- BO(n)
- CO(n!)
- DO(\(n^{n}\))