Fibonacci Function Gallery Series

https://fpilluminated.com/deck/252

In this deck we are going to look at a number of different implementations of a function for computing the nth element of the Fibonacci sequence.

In part 1 we look at the following:

  • Naïve Recursion
  • Efficient Recursion with Tupling
  • Tail Recursion with Accumulation
  • Tail Recursion with Folding
  • Stack-safe Recursion with Trampolining
2 Likes

Here is part 2 (infinite streams): Fibonacci Function Gallery - Part 2

In part 2 we look at the following:

  • Infinite Stream with Explicit Generation
  • Infinite Stream with Implicit Definition
  • Infinite Stream with Unfolding
  • Infinite Stream with Iteration
  • Infinite Stream with Scanning
2 Likes