Which algorithm would probably work better on a computer

Assignment Help Basic Computer Science
Reference no: EM131110076

The Fibonacci sequence is one of the most commonly found patterns in all of nature. The sequence starts with 0 and 1 , and then each term in the sequence is generated by adding the previous two terms. The first few terms in the sequence are 0,1,1 , 2, 3, 5, 8,13 , 21 , and 34. Numbers that appear in the sequence are called Fibonacci numbers.

a. Write a recursive algorithm in pseudo code to generate the Fibonacci sequence.

b. Write an iterative algorithm in pseudo code to generate the Fibonacci sequence.

c. Which algorithm would probably work better on a computer, and why?

d. Write an algorithm in pseudo code to test a number to see if it is a Fibonacci number.

e. Create an Alice world with a Count penguin and a Fibonacci penguin. Count penguin will simply start counting slowly when the world starts. The Fibonacci penguin will jump up and down and flap its wings while saying "Fibonacci, Fibonacci, (n) is Fibonacci!" when Count penguin says a number that is part of the Fibonacci sequence. The Fibonacci penguin should say the actual number in place of (n).

Reference no: EM131110076

Questions Cloud

Explain the contract law that the court applied to the case : From the e-Activity, discuss the major issues addressed in the case you found. Explain the contract law that the court applied to the case and why
Write the vhdl entity declare for a three-input and gate : Write the VHDL entity declare for a three-input AND gate. Write the VHDL architecture for a three-input AND gate. Draw the logic circuit to be implemented by the following VHDL architecture body:
What conclusion did the court reach regarding main dispute : What rule of law, statute, or constitutional provision was used by the Court to resolve the dispute? Explain , What conclusion/decision did the Court reach regarding the main dispute/issue?
Assume that ibm leased equipment that was carried at a cost : Assume that IBM leased equipment that was carried at a cost of $150,000 to Sharon Swander Company. The term of the lease is 6 years beginning January 1, 2011, with equal rental payments of $30,044 at the beginning of each year.
Which algorithm would probably work better on a computer : Write a recursive algorithm in pseudo code to generate the Fibonacci sequence.
What liability would you have for any contracts : What would the default be if you did not have an express agreement and did not choose a specific form of business organization? What liability would you have for any contracts or torts done for the benefit of and in the course of the business
How should evacuation plans be established : Proactive action plans are designed to protect the personnel that work in a particular building. How should evacuation plans be established? To where should those evacuated be relocated? How should these plans be practiced?
Imitate biological organic functions : 1. Composites designed to be insulators, conductors of heat, electricity etc., special electromagnetic properties while maintaining other special properties (these are more traditional multifunctional composites).2. Biologically based or inspired mat..
Jana kingston corporation enters into a lease : Jana Kingston Corporation enters into a lease on January 1, 2011, that does not transfer ownership or contain a bargain-purchase option.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Technical requirements develop a website

You are required to research and discusshow the "Right to be forgotten" ruling (C131/12) may affect the quality of information shared on the Internet. Build and publisha website to illustrate and draw out your findings.

  Analyze a hacking case using wireshark

Another option for the project is to analyze a hacking case using Wireshark. Wireshark is a free and open-source packet sniffer and protocol analyzer that you will learn about near the end of the class.

  Identify some distributed applications in the scientific

Identify some distributed applications in the scientific and commercial application areas

  An economist for the vanda-laye corporation

You are an economist for the Vanda-Laye Corporation, which produces and distributes outdoor cooking supplies. The company has come under new ownership and management and will be undergoing changes in its product lines and operating structure.

  Variables-constants and data types

Document the steps for the logic structure to capture the payment information. This can be done as either a flowchart or pseudocode. Be sure to include inputs, variable declarations and assignments, and outputs.

  Define the diffie-hellman key exchange

Define the Diffie-Hellman key exchange? How is this information relevant to you?

  What is stop word removal and stemming

Why are these processes necessary for better information retrieval?

  Develop an enterprise architecture plan to address

Develop an enterprise architecture plan to address and solve a proposed business ethical problem

  What is the duration of a particular type

A microprocessor is clocked at a rate of 8 GHz. a. How long is a clock cycle? 1/frequency=1/(8*10^9) b. What is the duration of a particular type of machine instruction consisting of six clock cycles?

  Write an assembly and a c program to measure their phase

Write an assembly and a C program to measure their phase difference.

  Use map to define convert-euro converts list of us dollars

Use map to define the following functions: convert-euro, which converts a list of U.S. dollar amounts into a list of euro amounts based on an exchange rate of 1.22 euro for each dollar.

  Write disadvantage of the condensed design circuit

what's the advantages and disadvantage of the condensed design circuit (2-bit multiiplier) ?? which one is better a condensed one or just the normal one ?? please good explanation

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd