Skip to content

RayHightower/fibonacci

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

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