Question: The code should add the polynomial numbers using a linked list. Java . Keep in mind the polynomials will be gotten from a file. Things
The code should add the polynomial numbers using a linked list. Java . Keep in mind the polynomials will be gotten from a file. Things to keep in mind the list should be in decending order and traverse the list after all coefficient/exponent pair Term nodes from one input line have been inserted. Here are the specifications
//The Polynomial class would likely have a single private data member (reference to class Term) called head.
//The Term class would likely have three private data members (coefficient and exponent of type int) and next of type reference to Term.
//The latter class would also have the following public methods: constructor(s), gets and sets for each data member, and perhaps a formatting method with the special output requirements. An example of input is : 5 1 2 3 6 0 -1 -1 3. should output :"2*X^3+(-3)*X^2+ 5*X + 6 =48 FOR X= 3"
15 0 -1 -1 100 should output " 15 = 15" For X = 100
// Note the special conditions, negative should be in parenthesis (refer to the first output example)
Negative negative pair signals the termination,
Example of the output is
No doubly linked list,
java code only
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
