Skip to content

lyndychivs/Fibonacci

Repository files navigation

Mutation testing badge NuGet Downloads

lyndychivs.Fibonacci

The Fibonacci Sequence as image

The Fibonacci Sequence in C# using recursion and iteration returning BigInteger values.

Tests & Examples

All Unit Tests can be found under the Fibonacci.Tests namesapce.

One Interface exists:

public interface IFibonacci
{
    BigInteger Get(int n);

    List<BigInteger> GetSequence(int length);
}

There are two concrete implementations of this Interface.

var fibonacci = new FibonacciIterative();

BigInteger result = fibonacci.Get(5);

List<BigInteger> sequence = fibonacci.GetSequence(3);
var fibonacci = new FibonacciRecursive();

BigInteger result = fibonacci.Get(5);

List<BigInteger> sequence = fibonacci.GetSequence(3);

Package

Available on: