Java Fibonacci Sequence Get fibonacci(int n)

Here you can find the source of fibonacci(int n)

Description

fibonacci

License

Apache License

Declaration

public static int fibonacci(int n) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static int fibonacci(int n) {
        if (n < 2)
            return n == 0 ? 0 : 1;
        return fibonacci(n - 1) + fibonacci(n - 2);
    }//from   w  w w  .j ava 2 s . c  o m
}

Related

  1. esFibo(long value)
  2. fib(int n)
  3. fiboCercano(long numero)
  4. fibonacci(int n)
  5. fibonacci(int n)
  6. fibonacci(long max)
  7. getFibonacci(int number)