Ask a Question

an algo to add two polynomial

on 2012-10-01 01:15:46   by Priyanka   on Information Technology  1 answers

Rajni

on 2012-10-03 09:30:00  

Algorithm Steps: Step 1: Read the cofficient and power of the polynomial euation one and assign it's elements into a linked list. step 2: Read the cofficient and power of the polynomial quation two and assign it's elements into a linked list. step 3: Sorting the first polynomial in power order wise. Compare the first node's power with next nodes power,if second node's power is greate than first Node then swap.Repeat the process until we get the proper order. Step 4: Sorting the second polynomial in power order wise. Compare the first node's power with next nodes power,if second node's power is greate than first Node then swap.Repeat the process until we get the proper order. Step 5 :Add the two polynomial. If power part of the two list is qual than add the coffiecient