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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:30
Exchanging which type of data uses the least bandwidth? music photographs video voice bandwidth- the amount of data that can be moved between two points in a set time period
Answers: 1
question
Computers and Technology, 24.06.2019 18:50
Which style did jack use on the vocabulary words in reports?
Answers: 2
question
Computers and Technology, 24.06.2019 21:00
How does a vaccine prevent sickness and individual?
Answers: 2
question
Computers and Technology, 25.06.2019 01:00
Your computer will organize files into order. alphabetical chronological size no specific
Answers: 2
You know the right answer?
(you need to have first completed programming project 13.1 to work on this project.) in this exercis...
Questions
question
Biology, 28.02.2020 23:17
question
Computers and Technology, 28.02.2020 23:17
question
Mathematics, 28.02.2020 23:17
question
Mathematics, 28.02.2020 23:17