r/programming • u/SilasX • May 09 '15
"Real programmers can do these problems easily"; author posts invalid solution to #4
https://blog.svpino.com/2015/05/08/solution-to-problem-4
3.1k
Upvotes
r/programming • u/SilasX • May 09 '15
1
u/spinlock May 09 '15
Just being snarky. If you rewrite your fibonacci function to be tail recursive, your compiler will handle optimizing it's memory use for you. fib(45) should take a lot less than 10 seconds (of course, it'll still be asymptotically slower than fib2).