Skip to content

wmartinmimi/fibonacci-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages