Java Reference
In-Depth Information
624
Repeat the process.
Write a program that draws the iterations of this curve. Supply a button
that, when clicked, produces the next iteration.
΢΢ Exercise P13.16. The recursive computation of Fibonacci numbers can be
speeded up significantly by keeping track of the values that have already
been computed. Provide an implementation of the fib method that uses
this strategy. Whenever you return a new value, also store it in an auxiliary
array. However, before embarking on a computation, consult the array to
find whether the result has already been computed. Compare the running
time of your improved implementation with that of the original recursive
implementation and the loop implementation.
Additional programming exercises are available in WileyPLUS.
PROGRAMMING PROJECTS
΢΢΢ Project 13.1. Enhance the expression parser of Section 13.5 to handle
more sophisticated expressions, such as exponents, and mathematical
functions, such as sqrt or sin .
Search WWH ::




Custom Search