Question: Project 1: Adding two polynomials with Linked Lists (?????????) 1: Introduction Problem description and (if any) background of the algorithms Description: First, enter every term
Project 1: Adding two polynomials with Linked Lists (?????????) 1: Introduction Problem description and (if any) background of the algorithms Description: First, enter every term (i.e., a pair (coefficient, exponent)) of the polynomial in order; then, store the one-variable polynomial into a linked list; next, create two linked lists of two polynomials. Finally, add the two polynomials in the two linked lists, and output the result. (??????????????,? ????????????,???2 ????????????,???? 2?????????,?????? ?????) Input Several sets of data are needed. Every set of testing data is required to be consistent with the following format The inputted first line is an integer n, i.e., the number of terms of the first polynomial La. Then input n lines, and each line represents one term of a polynomial, with each term including two elements: a coefficient and an exponent. Similarly, an integer m is then entered, which is the number of terms of the second polynomial Lb. Then, as before, enter each term of Lb. The exponents are entered by the order from smaller ones to larger ones
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
