Let p[0… n] be a vector of integer numbers that contains the coefficients of a polynomial of degree n≥0. For instance, the vector p=⟨3,2,5,−1⟩ represents p(x)=3+2x+5x2−x3, a polynomial of degree n=3.
Write a function
that evaluates the polynomial at the point x, that is, that returns ∑i=0n p[i]xi.
Use the Horner scheme:
Observation You only need to submit the required procedure; your main program will be ignored.