While trying to evaulate polynomials using Horner's Rule I have a sample code segment like so:
int Horner( int a[], int n, int x )
{
int result = a[n];
for(int i=n-1; i >= 0 ; --i)
result = result * x + a[i];
return result;
}
I understand that a
is an array of coefficients and that x
is the value that I would like to evaluate at. My question is what is the n
for?