Question: What is wrong with the following recursive function? int recursiveAlgorithm (int n) { if (n = 0) return 0; } printf(d,n): return n + recursiveAlgorithm
What is wrong with the following recursive function? int recursiveAlgorithm (int n) { if (n = 0) return 0; } printf("d",n): return n + recursiveAlgorithm (n) ; } int main() { int i = recursiveAlgorithm (5); printf("d", i); return 0; 1 A. It does not have a base case B. The general case does not reduce the size of the problem OC. The base case should be 1 OD. It should not have a base case E. it should be pass-by-reference and NOT pass-by-value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
