Question: We can define an abstract data type for single-variable polynomials (with non- f(x) - a, X.fmost of the coefficients a are negative exponents) by using


We can define an abstract data type for single-variable polynomials (with non- f(x) - a, X.fmost of the coefficients a are negative exponents) by using a list. Let nonzero we could use a simple array to store the coefficients and write routines to perform addition, subtraction, multiplication, differentiation, and other operations on these polynomials. An array implementation would be adequate for dense polynomials, where most of the terms are present, but f R)05x"+1and )-10x 90 -2x0+11x+5, then the runnin time is likely to be unacceptable. One cans see that if arrays were used, then most of the time is spend multiplying zeros and stepping through what amounts to nonexistent parts of the input polynomials. This is always undesirable An alternative is to use a singly linked list. Each term in the polynomial is contained int one cell, and the cells are stored in decreasing order of exponents. For instance, ne linked lists below represent ?(x) and 2(x) 3 1000 5 14 nul nu 10 1990 2 1492 Assignment 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 it's own class. However, you must include an application that demonstrates and tests the key functionality of your implementation. Your write/documentations up should
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
