Q. 9 The time complexity of the following C function is (assume n > 0)
int recursive(int n) {
if (n==1)
return(1);
else
return(recursive(n-1)+recursive(n-1);
}
Answer: (D)
Explanation:
Q. 9 The time complexity of the following C function is (assume n > 0)
int recursive(int n) {
if (n==1)
return(1);
else
return(recursive(n-1)+recursive(n-1);
}
Answer: (D)
Explanation: