Created
December 2, 2025 11:09
-
-
Save emanoelbarreiros/e9e70a579d9ad860597f74fba4ac1fad to your computer and use it in GitHub Desktop.
Fibonacci recursivo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Fibonacci { | |
| public static int fib(int n) { | |
| if (n <= 1) { | |
| return n; | |
| } else { | |
| return fib(n - 1) + fib(n - 2); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment