Q. 81 Consider the following C-function:
double foo(int n) { int i; double sum; if(n == ) { return 1.0; } else { sum = 0.0; for(i = ; i < n; i++) { sum += foo(i); } return sum; } }
The space complexity of the above function is:
(A) O(1)
(B) O(n)
(C) O(n!)
(D) O(nn)
Answer: (B)
Explanation: