Skip to main content

Insertion Sort

Definition​

Horner's method is an efficient algorithm for evaluating polynomials. It reduces the number of multiplications required to evaluate a polynomial by factoring out common factors, resulting in a faster computation process

Practice​

evaluatePolynomial(coefficients[], x):
n = length(coefficients)
result = coefficients[0] // Initialize result with the constant term
for i from 1 to n - 1:
result = result * x + coefficients[i] // Multiply result by x and add the next coefficient
return result