Recursionmedium
0:00.0
Consider this recursive algorithm:
function mystery(n):
if n == 0:
return 1
return 3 * mystery(n - 1) + 2
Which recurrence relation describes the time complexity (counting each operation as 1 unit)?
Consider this recursive algorithm:
function mystery(n): if n == 0: return 1 return 3 * mystery(n - 1) + 2
Which recurrence relation describes the time complexity (counting each operation as 1 unit)?