Write a program to implement the following strategy for multiplying two
Chapter 5, Problem 5.13(choose chapter or problem)
Write a program to implement the following strategy for multiplying two sparsepolynomials P1, P2 of size M and N, respectively. Each polynomial is represented asa linked list of objects consisting of a coefficient and an exponent (Exercise 3.12).We multiply each term in P1 by a term in P2 for a total of MN operations. Onemethod is to sort these terms and combine like terms, but this requires sortingMN records, which could be expensive, especially in small-memory environments.Alternatively, we could merge terms as they are computed and then sort the result.a. Write a program to implement the alternative strategy.b. If the output polynomial has about O(M + N) terms, what is the running timeof both methods?
Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.
Becoming a subscriber
Or look for another answer