id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

konstans@stuy.edu apcs2 > fibIter
prev  |  next  |  chance

A recursive method of Fibonacci that uses tail recursion. You may not call the recursion more than once. When f1 and f2 are 1 and 0 the output of fibIter(n,f1,f2) will be the nth Fibonacci number such that 0:1, 1:1, etc.


fibIter(0, 1, 0) → 0
fibIter(1, 1, 0) → 1
fibIter(2, 1, 0) → 1

...Save, Compile, Run (ctrl-enter)

public int fibIter(int n, int f1, int f2){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Copyright Nick Parlante 2017 - privacy