If I have 2 version of code
1.)
def T(n):
if n == 0:
return 1
return T(n-1)+T(n-1)
2.)
def T(n):
if n == 0:
return 1
return 2 * T(n-1)
Is my understanding correct that the time complexity of the first function is O(2^n) and the second function is O(n)