Skip to content

RayHightower/fibonacci

Repository files navigation

Fibonacci and Memoization

Sample code mentioned in the Recursion and Memoization blog post. This is a comparison of two recursive Fibonacci programs (blogpost_fibo_memo.rb and blogpost_fibo_raw.rb) written in Ruby. One uses memoization, and the other does not.

The remaining Ruby programs in this repo were written by other developers, noted in each file. Each looks at the problem in a different way.

By definition...

  • Fibonacci numbers are always positive integers.
  • The n th number in a fibonacci sequence is f(n). f(n) = f(n-1) + f(n-2)
  • The first two numbers of the sequence are 0 and 1, or 1 and 1 depending on the chosen starting point of the sequence.

About

Experiments with Fibonacci and memoization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages