subject
Computers and Technology, 18.10.2019 09:30 Haru3

(you need to have first completed programming project 13.1 to work on this project.) in this exercise, you will compare the efficiency of a recursive and an iterative function to compute the fibonacci number. a. examine the recursive function computation of fibonacci numbers. note that each fibonacci number is recomputed many times. to avoid this recomputation, do programming project 13.1 iteratively, rather than recursively; that is, do the problem with a loop. you should compute each fibonacci number once on the way to the number requested and discard the numbers when they are no longer needed. b. time the solution for programming project 13.1 and part a of this project in finding the 1st, 3rd, 5th, 7th , 9th, 11th, 13th , and 15th fibonacci numbers. determine how long each function takes. compare and comment on your results. hints: if you are running linux, you can use the bash time utility. it gives real time (as in wall clock time), user time (time measured by cpu cycles devoted to your program), and sys time (cpu cycles devoted to tasks other than your program). if you are running in some other environment, you will have to read your manual, or ask your instructor, in order to find out how to measure the time a program takes to run.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 20:30, carealee
What important technology has done the most to allow a businesses a chance to compete with larger international companies
Answers: 1
image
Computers and Technology, 23.06.2019 13:00, jaelynnm
Donnie does not have powerpoint. which method would be best for elana to save and share her presentation as is? a pdf a doc an rtf a ppt
Answers: 3
image
Computers and Technology, 23.06.2019 16:30, isaiahhuettnerowgg8d
What is one reason why indoor air pollution has become an increasing problem.
Answers: 1
image
Computers and Technology, 24.06.2019 14:00, Abrahamolve
When creating a field in a table, you must set the to determine what type of data the field can store. field property data type field type data property
Answers: 1
You know the right answer?
(you need to have first completed programming project 13.1 to work on this project.) in this exercis...

Questions in other subjects:

Konu
Social Studies, 29.11.2019 18:31