Given the following pseudocode, derive the recurrence relation that represents its time complexity. def fibonacci(n): if (n==0 or n==1): return n return fibonacci(n - 1) + fibonacci(n - 2)Let b and c represent constant values. What is the base case and recurrence step?单项选择题

题目图片
A

T(n) = T(n-1) + T(n-2) + c T(0) = T(1) = n

B

T(n) = T(n-2) + c T(1) = T(0) = b

C

T(n) = T(n-1) + T(n-2) + c T(1) = T(0) = b

D

T(n) = T(n-1) + c T(1) = T(0) = b

登录即可查看完整答案

我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。

类似问题

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!