Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created February 5, 2019 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/01595c087a1a6d3c72e7394e8d8ac4d1 to your computer and use it in GitHub Desktop.
Save parzibyte/01595c087a1a6d3c72e7394e8d8ac4d1 to your computer and use it in GitHub Desktop.
/**
* Sucesión fibonacci recursiva en Java
*
* @author parzibyte
*/
public static long fibonacciRecursivo(long posicion) {
if (posicion < 2)
return posicion;
return fibonacciRecursivo(posicion - 1) + fibonacciRecursivo(posicion - 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment