Question: Suppose you have two polynomials P ( x ) and Q ( x ) which are to be multiplied together. Assume that P ( x

Suppose you have two polynomials P(x) and Q(x) which are to be multiplied together. Assume that P(x) has n non-zero terms and that Q(x) has m non-zero terms, where n > m. The polynomials are represented using linked lists for reasons of space efficiency and the lists should store the non-zero terms ordered from largest power to smallest power. (a) Draw a picture of the linked-list representation of P(x)=2x 16+4x 3(3 marks.)(b) Give an O(n \times m2)-time algorithm for performing the multiplication (12 marks.)(c) Weiss proposes an alternative algorithm based on generating all of the n\times m terms in the product, sorting these according to the exponent and then coalescing together any adjacent terms that have identical exponent. Comment on

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!