Exercises 40—43 refer to another algorithm, known as Horner’s rule, for finding the value of a polynomial.
Algorithm 11.3.4 Homer’s Rule
[This algorithn computes the value of a polynomial by nesting successive additions and multiplications as indicated in the following parenthesization:
At each stage, starting with
, the current value of polyval is multiplied by x and the next lower coefficient of the polynomial is added to it.] Input: n[a nonnegative integer],
[an array of real numbers], x [a real number] Algorithm Body:
for to n next i
Output: polyval [a real number]
41. Trace Algorithm 11.3.4 for the input and .
The trace table of the algorithm for the given information.
Following data is given.
The considered algorithm for Horner’s Rule is as follows.
[a nonnegative integer], [an array of real numbers], [a real number] Algorithm Body:
[at this point
Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!Get Started