Polynomial Addition A = 4x 10 + 3x 6 + 1 B = 3x 10 – 2x 8 + 6x 6 + 8x 4 How Polynomial addition is done? In the above image we perform polynomial addition using linked list We use two pointers i and j for pointing A and B. In this liked list there will be 3 parts they are COEFFICIENT , EXPONENT, LINK (the pointer that points to the next node) First, We compare the Exponent of first element(i) in A and the Exponent of the first element(j) in B. Next, if the coefficient are same then we add and store them in C in form of ( COEFFICIENT , EXPONENT, LINK) ...
Comments
Post a Comment