Suppose you'd like to multiply the two polynomials of the previous
subsection:
, and
.
Their product has degree
:
A special case occurs when either polynomial is the zero polynomial. In that case, the product is the zero polynomial.
Implement the function mult specified in
Polynomial.h. You need
to be sure that none of your coefficients, or intermediate
calculations, fall outside INT_MAX
, specified in
<limits.h> (in which case you should return {NULL,
OVERFLOW}). For polynomials of degree and
(assuming that
), your function should have complexity
.