0% found this document useful (0 votes)
591 views

Polynomial Manipulation

This document discusses different ways to represent polynomials and how to perform operations on them. It explains that polynomials can be represented using arrays or linked lists, with arrays arranging exponents from lowest to highest and linked lists using a structure with coefficient and exponent fields. It also outlines that adding polynomials involves comparing exponents and adding coefficients, while multiplying requires manipulating each term by adding exponents and multiplying coefficients.

Uploaded by

Sarthak Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
591 views

Polynomial Manipulation

This document discusses different ways to represent polynomials and how to perform operations on them. It explains that polynomials can be represented using arrays or linked lists, with arrays arranging exponents from lowest to highest and linked lists using a structure with coefficient and exponent fields. It also outlines that adding polynomials involves comparing exponents and adding coefficients, while multiplying requires manipulating each term by adding exponents and multiplying coefficients.

Uploaded by

Sarthak Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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:

Linked list representation:


A structure may be defined such that it contains two parts- one is the
coefficient and second is the corresponding exponent.
The structure definition may be given as shown below:

struct polynomial
{
int coefficient;

int exponent;
struct polynomial *next;
};

Thus the above polynomial may be represented using linked list as shown below:

Addition of two Polynomials:


Addition of two polynomials using linked list requires comparing the
exponents.
Wherever the exponents are found to be same, the coefficients are added
up.
For terms with different exponents, the complete term is simply added to the
result thereby making it a part of addition result.

Multiplication of two Polynomials:


Multiplication of two polynomials however requires manipulation of each
node such that the exponents are added up and the coefficients are
multiplied.
After each term of first polynomial is operated upon with each term of
the second polynomial, then the result has to be added up by comparing
the exponents and adding the coefficients for similar exponents and
including terms as such with dissimilar exponents in the result.

You might also like