Two solutions are in this video. The first is a naive implementation of a Fibonacci function and the second uses tail recursion to achieve O(n) time complexity.
We also make a simple timer to compare them.
(Source code available for premium members)
Related episodes:
No Comments