document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import java.math.BigInteger;
  2.  
  3. /*
  4.  ===========================================================================
  5.  Author      : Catarina Moreira
  6.  Copyright   : Catarina Moreira all rights reserved
  7.  Description : Implementation of the fibonacci sequence using recursion
  8.  ===========================================================================
  9.  */
  10.  
  11. public class Recursive
  12. {
  13.     public BigInteger runFibonacci( int n )
  14.     {
  15.        if( n == 0)
  16.           return BigInteger.ZERO;
  17.        
  18.        if( n == 1)
  19.       return BigInteger.ONE;
  20.        
  21.        return runFibonacci( n - 1 ).add(runFibonacci( n - 2 ));
  22.     }
  23. }
');