by thefaux · 2y ago · 0 comments
I feel like, in this case, the recursivity in definition of Fibonacci and the recursivity in the tail recursion is just a coincidence, with the second just being a contrived way to write the loop you get after applying dynamic programming and trimming the table to only the last two elements.
Here's one way: https://gist.github.com/tmoertel/5798134