Question: Starting with the class Skeleton, below, Implement the Polynomial ADT using linked lists. You are Not to use the Java LinkedList class, you should roll
Starting with the class Skeleton, below, Implement the Polynomial ADT using linked lists. You are Not to use the Java LinkedList class, you should roll your own list/node data types.
Your project will be graded automatically, so you must make the Polynomial ADT its own class. However, you must include an application that demonstrates and tests the key functionality of your implementation. Your write/documentations up should include a discussion of what you used and the documentation html files generated by javadoc.
public class Literal {
// various constructors & accessors (not shown)
double coefficient;
int exponent;
//if you roll your own list, then include Literal next;
}
public class Polynomial {
private List terms ; // A list of literals
// if you roll your own, then private Literal head;
public Polynomial() {
// constructor to be implemented
}
public void insert term(double coef, int exp){
// to be implemented
}
public Polynomial add(Polynomial rhs) {
// to be implemented
}
public Polynomial multiply(Polynomial rhs) {
// to be implemented
}
public String toString(){
// to be implemented use ^ to signify exponents
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
