TAOCP 5.2.3 Exercise 29

Solution to TAOCP 5.2.3 Exercise 29.

Section 5.2.3: Sorting by Selection

Exercise 29. [26] (W. S. Brown.) Design an algorithm for multiplication of polynomials or power series $(a_1 x^{r_1} + a_2 x^{r_2} + \cdots)(b_1 x^{s_1} + b_2 x^{s_2} + \cdots)$, in which the coefficients of the answer $c_1 x^{r_1 + s_1} + \cdots$ are generated in order as the input coefficients are being multiplied. [Hint: Use an appropriate priority queue.]

Verified: no
Solve time: 1m33s


Setup