Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Referring to the slides from text book, Chapter 5, there are two versions of Fibonacci number calculators:

BinaryFib(n) and LinearFibonacci(n).

The first algorithm has exponential time complexity, while the second one is linear. In this programming assignment, you will implement in Java both the versions of Fibonacci calculators and experimentally compare their runtime performances.

For that, with each implemented version you will calculate Fibonnaci (5), Fibonacci (10), etc. in increments of 5 up to Fibonacci (100) (or higher value if required for your timing measurement) and measure the corresponding run times. You need to use Java's built-in time function for this purpose.

You should redirect the output of each program to an out.txt file. You should write about your observations on timing measurements in a separate text or pdf file.

You are required to submit the two fully commented Java source files, the compiled executables, and the text/pdf files. Briefly explain why the first algorithm is of exponential complexity and the second one is linear (more specifically, how the second algorithm resolves some specific bottleneck(s) of the first algorithm).

You can write your answer in a separate file and submit it together with the other submissions. Do any of the previous two algorithms use tail recursion? Why or why not? Explain your answer.

If your answer is "No" then design the pseudo code for a tail recursive version of Fibonacci calculator; implement the corresponding Java program and repeat the same experiments as in part (a) above.

You will need to submit both the pseudo code and the Java program, together with your experimental results. Submit all your answers to written questions in PDF or text formats only.

For the Java programs. you must submit the source files together with the compiled executables. The solutions to all the questions should be zipped together into one .zip file and submitted via EAS (Refer to the course outline for more details on submission guidelines).

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93108605

Have any Question?


Related Questions in Computer Engineering

1nbsphillary wants to go to disneyland in 425 years she

1) Hillary wants to go to Disneyland in 4.25 years. She wants to take her partner and 2 kids (4 people in Total). If it is going to cost $453.27 per person to go on the trip. -What will the cost be for the entire trip? - ...

Question 1 search for information on system and equipment

Question: 1. Search for information on system and equipment failure on your favorite search engine. 2. List what might be done to provide fault tolerance for a single system. 3. List what might be done to provide fault t ...

Discuss the relationship between fundamental analysis and

Discuss the relationship between fundamental analysis and intrinsic value. Include real-world examples in your explanation.

Java program that does the following please use simple

Java program that does the following: Please use simple computer syntax. More easy to understand! Use a while loop to prompt the user to enter 10 rain falls. Calculate and output the total and the average rain fall. Find ...

Question suppose that an attack would do 200000 in damage

Question : Suppose that an attack would do $200,000 in damage and has a 25% annual probability of success. Spending $15,000 per year on Countermeasure A would reduce the damage of a successful attack by 50%. a) Do a risk ...

Question you have been recently promoted to lead a new

Question: You have been recently promoted to lead a new division of Company XYZ. This company is known for its team-oriented atmosphere, and your boss has raved about some of your natural leadership qualities. Your first ...

Describe how to discover cookies on web browsers what is a

Describe how to discover cookies on web browsers. what is a reverse DNS lookup and can it be used when attacking the network.

C programmingnbsphelp with a program positivec that include

***C PROGRAMMING***  Help with a program positive.c that include the following function: void extract(int *a, int n, int *positive, int *size);  The function should use pointer arithmetic, not subscripting. The extract f ...

When a developer creates an app should they make it

When a developer creates an app, should they make it backwards compatible, so that the app can be handled by older versions of the operating system? Why or why not?

It has been argued that although there may be more claims

It has been argued that although there may be more claims when road conditions are slippery in the winter, this should not affect the average claim. Malpeque took a sample of 50 claims from the winter of 2018 and found t ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As