Polynomial Manipulation
Polynomial Manipulation
Representation of a Polynomial:
A polynomial is an expression that contains more than two terms.
A term is made up of coefficient and exponent.
An example of polynomial is P(x) = 4x3+6x2+7x+9
A polynomial may be represented using arrays or linked lists.
Array representation:
Array representation assumes that the exponents of the given expression are
arranged from 0 to the highest value (degree), which is represented by the
subscript of the array beginning with 0.
The coefficients of the respective exponent are placed at an appropriate
index in the array.
The array representation for the above polynomial expression is given below:
struct polynomial
{
int coefficient;
int exponent;
struct polynomial *next;
};
Thus the above polynomial may be represented using linked list as shown below: