Home BCA Write an algorithm to add two polynomials

Write an algorithm to add two polynomials

Let p and q be the two polynomials represented by the linked list.
1. while p and q are not null, repeat step 2.
2. If powers of the two terms ate equal
then if the terms do not cancel then insert the sum of the terms into the sum Polynomial
Advance p
Advance q
Else if the power of the first polynomial> power of second
Then insert the term from first polynomial into sum polynomial
Advance p
Else insert the term from second polynomial into sum polynomial
Advance q
3. copy the remaining terms from the non empty polynomial into the
sum polynomial.

NO COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Call us! +919811854308
WhatsApp us! +919811854308
DMCA.com Protection Status Get it on Google Play Download on the App Store