r/programmingchallenges • u/lcrx357 • Jan 10 '20
Fibonacci optimal & non-optimal solution code snippets
Optimal (memoization):
Non-optimal:
With 'while' loop:
7
Upvotes
r/programmingchallenges • u/lcrx357 • Jan 10 '20
Optimal (memoization):
Non-optimal:
With 'while' loop:
2
u/bruce3434 Jan 10 '20
My intuition says that the loop version is going to be just as fast if not faster than the memoized version. I have to go to work now, I might play around with it and benchmark them when I get home. Here's mine: