Question
Here is my Fibonacci.java code: public class Fibonacci { public static void main(String[] args) { int test = 45; // I will limit my test
Here is my Fibonacci.java code:
public class Fibonacci { public static void main(String[] args) { int test = 45; // I will limit my test code to passing int parameters BigInteger test2 = new BigInteger("45"); // only needed for overload System.out.println(theBigFib(test)); // a fast recursive version System.out.println(theBigFib(test2)); // overload, using same as above System.out.println(fibonacci(test)); // slow version in text } // this method will do the fibonacci calculation, but is very inefficient and slow. public static int fibonacci(int n) { if (n value) { return next; } return theBigFibHelper(next, first.add(next), count + 1, value); } }
Use the System clock (milliseconds) and demonstrate run-time complexity for Assignment #12 (Fibonacci) Are they O(N), or O(NA2), or O(2AN), or O(NAN), or O(1), or O(N!), or??? for these two algorithms, where N is the number of Fibonacci numbers generated. One is very fast (so you test with huge N values), and the one provided in the problem statement is very slow (can hardy get past N of 50) Create an Excel workbook of your results, and clearly (in titles) indicate your answers for Big-O. Your charts should have a title, label axes, a line that proposes your answer, and appropriate scales from zero to whatever is large enough to encompass your data. Everyone will have different data, but we should all come to the same Big-O conclusions, that fibonacci(test) is O??? and the BigFib(test2) is O??? You will likely start with some preliminary results, using just 8 or 10 elements as suggested in text, often getting slightly different results, something like Preliminary.JPG In the end you will clean things up and get a more polished final chart that displays on the first worksheet along with your data FinalEst.JPG Crucial consideration: Big-O is the trend (slope) from small N to large N. theBigFib will use much larger N values for testing, as compared to the slow provided fibonacci method. Submit 2 files here: 1. your Testing.java program 2. your Excel workbook (xlxs)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started