Solution (source code)

= Solution

A suitable <Oberon> linked representation is

``
TYPE
  poly = POINTER TO term;
  term = RECORD
    coeff: T;
    power: INTEGER;
    next: poly
  END;
``

`NIL` denotes the zero polynomial. Each power is a nonnegative integer, and the intended sparse representation omits zero coefficients. No sorted-order assumption is needed for the operations below. Coefficients are treated as values with equality to zero, addition and multiplication; mutable coefficient objects would need the corresponding copying discipline.