Univariate Polynomial Evaluation using Horner Scheme

A linear-space linear-time sequential recursive algorithm for evaluating a univariate polynomial (a polynomial of one variable) is the Horner scheme:

Function evaluate : (A, x) : y is, where a is the top of A,

  1. If A is empty, y is zero.
  2. Otherwise if A is a singleton, y is a.
  3. Otherwise, y is a + x * evaluate : (B, x), where B is A without a (the result of popping a from A).

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*