Question: 3.2 The Exercises Define new classes called Logarithmic, NlogN, Quadratic, Cubic and Exponential in which method and complexity have the corresponding complexity. Time execution of


3.2 The Exercises Define new classes called Logarithmic, NlogN, Quadratic, Cubic and Exponential in which method and complexity have the corresponding complexity. Time execution of the various methods with various values of n, and analyse the results. In the timing exercises, do not use large values of n for the more complex classes, especially not for the Exponential class. The logbook exercises are the Logarithmic and Cubic classes. You should include timing results and analysis in your logbook. Please note: Your implementations should reflect aspects of typical examples of the corresponding complexity classes e.g. polynomial methods (linear, quadratic, cubic, etc.) typically have (nested) loops, exponential methods are usually recursive, with more than one recursive call, and logarithmic methods are typically "divide and conquer" where the "size of the problem" (the value of n) is halved on each iteration. In other words, while public void method (int n) { for (int i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
