Created
March 5, 2016 18:10
-
-
Save deyindra/6e6789266fd008b6f44e to your computer and use it in GitHub Desktop.
Finding Nth Fibonacci
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 static int findingNthFibo(int n, int start, int end){ | |
if(n==1){ | |
return start; | |
}else if (n==2){ | |
return end; | |
}else{ | |
return findingNthFibo(n-1,start,end)+findingNthFibo(n-2, start,end); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment