Exercises 36—39 refer to the following algorithm to compute the value of a real polynomial.
Algorithm 11.3.3 Term-by-Term Polynomial Evaluation
[This algorithm computes the value of a polynomial by computing each term separately, starting with , and adding it to an accumulating sum.]Input: n [a nonnegative inreger],
[an array of real numbers], x [a real number]Algorithm Body:
for to n for to i next j next i
Output: polyval [a real number]
38. Let the number of additions and multiplications that are performed when Algorithm 11.3.3 is executed for a polynomial of degree n. Express as a function of n.
To find out the term Sn by using the polynomial algorithm executed for degree n.
Let us assume that input having some integer n (using polinomial algorithm)
Each iteration of the inner for −loop excute ,total 1 miltiplication per iteration of the inner for-loop and j can goes to 1 to i which are and i goes up to n possible values.
Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!Get Started