Guest User

Untitled

a guest
Jul 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. public static int prevFibHelper(int wanted, int current, int prev) {
  2. if (wanted == current) {
  3. return prev;
  4. }
  5. else {
  6. prevFibHelper(wanted, (current + prev), current);
  7. }
  8. }
  9.  
  10.  
  11. public static int prevFib(int x) {
  12. return prevFibHelper(x, 0, 1);
  13. }
Add Comment
Please, Sign In to add comment