Home > Back-end >  Bosses and all the great god of all stripes to solve it
Bosses and all the great god of all stripes to solve it

Time:09-19

Has two unary polynomial:
P (x)=p0 + p1x + p2x2 +... + PNXN
Q (x)=q0 + q1x + q2x2 +... + QMXM
Index as an integer, the design program to realize a unary operation:
Establish: (1) polynomial list to inputs (coefficient of index) way to establish polynomials, return the established the head of the linked list node;
(2) the polynomial order: will decrease the established polynomial index than (since) sort;
(3) polynomial addition: implement two polynomial addition operation, operation generates a new polynomial, the original two polynomial is changeless, return to generate polynomial head node;
(4) the output of the polynomial;
5. The main function by calling the polynomial list set up functions, enter two polynomial and output respectively; Output sorted two polynomial; Respectively called addition of polynomial function polynomial addition, subtraction, respectively output operations as a result,
  • Related