Question: The programming language is PYTHON. I also need it in OOP. Thank you! 1.Polynomials Lab, A Linked List Application A polynomial may be represented as

The programming language is PYTHON. I also need it in OOP. Thank you!
1.Polynomials Lab, A Linked List Application A polynomial may be represented as a linked list where p each node contains the coefficient and exponent of a 43 32 term of the polynomial. For example, the polynomial 4x + 3x - 5, would be represented as shown at right. 4x2 -50 -50 + Write a program that reads two polynomials from the keyboard, stores them as linked lists, adds them together to form a third linked list, and then prints the result as a polynomial. For the polynomial above, input would be: 4 3 3 2-50. Hint: Traverse both polynomials and if a particular exponent value is present in only one of the two polynomials being summed, then it should be present in the answer. If it is present in both polynomials, then its coefficient is the sum of the corresponding coefficients in both polynomials. If this sum is zero, the term of course, should be deleted. Also, coefficient 1 and -1 is not shown unless the exponent is zero. We have not yet indicated the order of storing the terms of the polynomial. If we allow them to be stored in any order, then it might be difficult to recognize that x + x2 - 3 and -3 +x+x and x?. 3+xall represent the same polynomial . Hence we adopt the convention that the terms of every polynomial be stored in the order of decreasing exponents within the linked list, and we further assume that no two terms have the same exponent, and that no term has a zero coefficient Below are three input/output examples: Sample Input Expected Output line 1: 2 2 3 2 2 1 -5 6 0 O line 2: 7 2x3-2x2+7x+1 -2 4 -4 7 line 1: line 2: 3 3 0 1 0 5 1 -7 3x -1 1 1 line 1: line 2: 5 3 2 -1 3 0 2 1 CO -3x5+2x4+x+3+3 Challenge Allow inputting polynomials in any order of exponents but display the sum polynomial in descending order as above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
