Skip to content

About

Calculate the nth fibonacci number using java

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fibonacci-java

Description

Calculate the nth Fibonacci number using java.

A fun simple project I played with.

Files

  • Fib.java

    First version of the calculation.

    Fn(n + 1) = F(n) + F(n - 1)

  • FibN.java

    Second version of the calculation.

    F(2n) = (2F(n) + F(n - 1)) * F(n) F(2n - 1) = F(n - 1)² + F(n)²

  • FibT.java

    Third version of the calculation.

    Does essentially the same as FibN.java, but first generate quick path from top to bottom before calculating from bottom to top using the path.

    Now also work with negative nth Fibonacci.

Usage

java Fib.java <n>

or

java FibN.java <n>

or

java FibT.java <n>

Example

java FibT.java 10000

Last Readme update

  • Date: 03-02-2023 dd-MM-yyyy

About

Calculate the nth fibonacci number using java

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages