Question: Write a pseudocode algorithm for polynomial division. polynomials are represented with an array. e.g. 1 + 2x^2 - x^3 is represented by the array [1,
Write a pseudocode algorithm for polynomial division.
polynomials are represented with an array. e.g. 1 + 2x^2 - x^3 is represented by the array [1, 0, 2, -1]
Use the following definition of polynomial division:
Given two polynomials u and v, with v != "0", you can divide u by v to obtain a quotient polynomial q and a remainder polynomial r satisfying the condition u = "q * v + r", where the degree of r is strictly less than the degree of v, the degree of q is no greater than the degree of u, and r and q have no negative exponents.
For the purposes of this problem, the operation "u / v" returns q as defined above.
Some examples of how the algorithm should behave:
(x^3-2*x+3) / (3*x^2) = 1/3*x (with r = "-2*x+3").
(x^2+2*x+15) / (2*x^3) = 0 (with r = "x^2+2*x+15").
(x^3+x-1) / (x+1) = x^2-x+2 (with r = "-3").
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
