Compare the number of operations and the cpu time

Assignment Help C/C++ Programming
Reference no: EM13938567

I need help to writing a program "VC++.net" with the specified input and output.

Use a computational program or programs you have written to do the following exercises.

Given any non-negative integer n,

a.Find the nth Fibonacci number using iteration.

b.Find the nth Fibonacci number using recursion.

c.Compare the number of operations and the CPU time needed to compute Fibonacci numbers recursively vs. that needed to compute them iteratively.

Maybe these pseudocodes been helpful;

A Recursive Algorithm for Fibonacci Numbers.

Procedure fubonacci(n: nonnegative integer)
If n = 0 then Fibonacci(0) := 1
else if n = 1 then fiponacci(1) :=1
else fibonacci(n) := Fibonacci (n - 1) + fibnacci(n - 2)

An Iterative Algorithm for computing Fibonacci Numbers.

Procedure iterative Fibonacci (n : nonnegative integer )
If n=0 then y:=0
else
begin
x := 0
y := 1
For i := 1 to n - 1
begin
z := x + y
x := y
y := z
end
end

Reference no: EM13938567

Questions Cloud

Analysis based on a self-designed fictitious study : For this assignment you will undertake an analysis based on a self-designed fictitious study that utilizes statistical analyses. You will first develop a fictitious problem to examine. It can be anything.
Stockholm conference on the human environment : The 1972 Stockholm Conference on the Human Environment had three major products: The Action Plan to protect the global environment; the United Nations Environment Programme and the related Environment Fund; and the Stockholm Declaration on the Hum..
Describe pathological processes involved in degeneration : Describe the pathological (disease) processes involved in degeneration and herniation and of the vertebral disks and how these disease processes represent an alteration from the normal physiology of the vertebral column.
Why did the controller compute depreciation expense : Why did the controller compute depreciation expense on the financial statements as he or she did? What are the possible consequences of the controller's decision on the amount of depreciation expense?
Compare the number of operations and the cpu time : Compare the number of operations and the CPU time needed to compute Fibonacci numbers recursively vs. that needed to compute them iteratively.
The program outputs the area of the floor in square feet : a) Write a Pseudocode to represent the logic of a program that allows the user to enter values for the width and length of a room's floor in feet. The Program outputs the area of the floor in square feet.
State the research approach to investigate the issue : My assignment is about a research proposal of my own chosen subject. Mine is: (an evaluation of the nurse to patient ratio for the registered nurses working in stroke wards in Australian hospitals and it's impact on patient's risk of morbidity and..
Write a pseudocode to represent the logic of a program : Write a pseudocode to represent the logic of a program that allows the user to enter two values. the program outputs the product of the two values.
How drug tolerance and conditioning may factor into outcome : Jim has taken heroin for the past 5 years. One day, Jim and Jack go out and both use large quantities of heroin. Although both did the same amount of drugs, Jack dies from an overdose. Discuss how drug tolerance and conditioning may factor into th..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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