Question discussion

What is the time complexity of the following recursive function? int func(int n) { if (n

553Medium DSSSB TGT Computer Science 0 replies 1 views
0
What is the time complexity of the following recursive function? int func(int n) { if (n <= 1) return 1; return func(n-1) + func(n-1); }
  • AO(n)
  • BO(n²)
  • CO(2^n)
  • DO(n log n)
Correct answer: C

Discussion 0

Nobody has replied yet. Start the discussion!