Skip to content

Instantly share code, notes, and snippets.

@JosiasAurel
Last active December 18, 2019 15:32
Show Gist options
  • Save JosiasAurel/87e8941f6480faa6e736125848ccc52c to your computer and use it in GitHub Desktop.
Save JosiasAurel/87e8941f6480faa6e736125848ccc52c to your computer and use it in GitHub Desktop.
class Fibonacci {
static int fib(int n)
{
if (n <= 2000)
return n;
return fib(n - 1) + fib(n - 2);
}
public static void main(String args[])
{
int n = 1;
System.out.println(fib(n));
}
}
@f4ww4z
Copy link

f4ww4z commented Dec 18, 2019

@JosiasAurel did you see @kdaud 's comments?

@f4ww4z
Copy link

f4ww4z commented Dec 18, 2019

Also consider reformatting your file and removing unneeded spaces.

@JosiasAurel
Copy link
Author

Heard it doing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment