Question: Code in Java using tge import BigInteger: I want the code for Polynomial.add where I am multiplying two polynomials. The time complexity is very crucial
IROGERS 8:46 AM mycourses2.mcgill.ca 2 of 5 uct In mathematics, a polynomial is an expression constructed from variables and constants, using the operations of addition, subtraction, multiplication, and constant non-negative integer exponents. For example, 5x -4x7 is a polynomial. In general, a polynomial can be written where the coefficients ca are real numbers and 0. As explaned below, in this assignment, the coefficients and the variables x will be integers, represented with the Java Biginteger class Polynomials are heavly used in computer science and in mathematics and also in many other sciences. They are the basis of many models in physics and chemistry and other natural sciences, as well as in the social sciences such as economics. For example, they are commonly used to approximate functions. An example is a Taylor series expansion of a smooth function. Another example is that any continuous function on a closed interval of the real ine can be approximated as closely as one wishes using a polynomial We will use a singly linked list data structure to represent polynomials and perform basic operations on them, such as addition and multiplication. Essentially, you will write a Polynomial class that builds upon the functionality of a linked list class. The starler code defines four dlasses which are as folows: .Polynomial-This class defines a polynomial in one variable with positive integer exponents. Most of your work goes into this function. You should use the methods provided with the inked list class to implement the methods of this class. You will notice that the template we provided use Java Biginteger for storing the polynomial coefficient and variable. We intentionally chose Biginteger over floating point (e.g double) to avoid numerical issues associated with polynomial evaluation. SLinkedList This class implements a generic singly linked ist. You do not have to implement the functionality of linked ist as it is already provided with the starter code. However, you must implement the cloning functionality (Task 1 see below) for performing a deep copy of the list Term-This is a simple class that represents a single term of a polynmomial Example: 5x. This class is also provided with the starter code. You do not have to modify this class, but you are required to understand what it does and how .DeepCopy This is a small user defined interface for enforcing deep copy functionality You are not required to understand Java interfaces for completing this assignment as the underlying complexity is handled by the starter code. We will discuss Java interfaces in the lectures a few weeks from now
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
