Question: This problem is about evaluation of a polynomial p(x) = c1c2x+C3x + + Cnx-1 (a) Here is a little code to do the evaluation.

This problem is about evaluation of a polynomial p(x) = c1c2x+C3x +

This problem is about evaluation of a polynomial p(x) = c1c2x+C3x + + Cnx-1 (a) Here is a little code to do the evaluation. y = c(1); xpow = 1; for i = 2:n xpow = xpow * x; end yyc (i) *xpow; Assuming that x is a scalar, how many flops does this code take, as a function of n? Provide both the exact answer and the asymptotic answer as n . (b) Here is another code to do the same task. This algorithm is called Horner's rule. y = c(n); for j = n-1:-1:1 yyxc(j); end Assuming that x is a scalar, how many flops does this code take, as a function of n? Provide both the exact answer and the asymptotic answer as noo. Then compare the count to the one from (a). Ac

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!