Home / MCQ Bank / Computer
Computer Miscellaneous On Data Structures Difficulty: Medium

What is the space complexity of the following recursive implementation to find the nth fibonacci number? int fibo(int n) { if(n == 1) return 0; else if(n == 2) return 1; return fibo(n - 1) + fibo(n - 2); } int main() { int n = 5; int ans = fibo(n); printf("%d",ans); return 0; }

Select the correct option to test your answer:

More Computer Questions

Which operator has the lowest priority? What will be the output of the following Python code? values = [[3, 4, 5, 1], [33, 6, 1, 2]] v = values[0][0] for lst in values: for element in lst: if v > element: v = element print(v) In advanced MapReduce, what is the purpose of the Hadoop MapReduce "Side Data Distribution"? What is bootstrap's global default font-size? Payroll Auto fill is done through