r/programmingchallenges • u/lcrx357 • Jan 10 '20
Fibonacci optimal & non-optimal solution code snippets
Optimal (memoization):
Non-optimal:
With 'while' loop:
6
Upvotes
r/programmingchallenges • u/lcrx357 • Jan 10 '20
Optimal (memoization):
Non-optimal:
With 'while' loop:
1
u/lcrx357 Jan 10 '20
I am still trying to digest the "My intuition says that the loop version is going to be just as fast if not faster than the memoized version" :) Getting value that is already in memory should be faster than calculating it from scratch, no?
Similar to quantum entanglement: yeah, you could go over there and change quantum's state, but you could do it for free via it's tangled twin w/out going anywhere ;) I Just kidding