Practical day 4 - Array based representation of polynomials
Polynomials can be represented with array where the index in the array denotes the power of the variable and the value in those indexes are the coefficient.
So let’s take this following polynomial -
Now this will be represented in array as -
[7,0,2,5]
So with this following representation we can try to perform the following operations with polynomials represented with array -
- Print a polynomial from the representation
- Add two polynomials
- Subtract two polynomials
- Multiply two polynomials
- Differentiate a polynomial
- Integrate a polynomial