package labs; import javax.swing.JOptionPane; public class FiboRecurse { /** Counts the number of times fibrecurse method is run. * You need to add code to make this count work. * * Compare the difference between this number in the recursive and iterative * approach for different values of n */ private static int fiboRecurseCounter = 0; public static void main(String[] args) { String input = JOptionPane.showInputDialog("Enter the value for n the size of the Fibonacci sequence (bigger than 10 takes a LONG time) : "); int n = Integer.parseInt(input); /* add function call to the function fiborecurse here * /* add the call to the print the nth Fibonacci number and the number of times * fiborecurse was run */ System.exit(0); } /** Recursively generate the ith Fibonacci number. (i is passed in.) * The Fibonacci series is given by the relation: * F(n) = 0 if n=0 * F(n) = 1 if n=1 * F(n-1)+F(n-2) if n > 1 */ public static int fiborecurse(int i) { int f; if(i==0) { f=0; } else if(i==1) { f=1; } else { /* add the recursive call to the function fiborecurse */ } return f; } }