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:
View all comments
Show parent comment
1
u/bruce3434 Jan 10 '20
343358302784187294870275058337 is a big number, I don’t know what JS does to handle it without overflowing. With rust or C you need a bigint library like libgmp. At that point the performance largely relies on the bigint library implementation.