Wood I don't think you got the runtime of b correct
b(n) = b(n-1) + b(n-2) <= 2b(n-1)
if we build and execution tree, it is going to be a binary tree, with height n - 1, the number of nodes in the tree give us the number of calls, which is going to be 2^n. Am I missing an important part here ??? Try the real tree with n= 6, I am getting 15 calls, and n=5 yields 9 calls
Code:
b(7) = b(6) + b(5) = 24
b(8) = b(7) + b(6) = 24 + 15 = 39
b(9) = b(8) + b(7) = 39 + 24 = 63
b(10) = b(9) + b(8) = 63 + 39 = 102
that does not seem like a linear growth to me. what do you think?
Bookmarks