Polynomial multiplication problem
Problem input
Problem output
Polynomial definition
- Polynomial can be represented in memory as an array of coefficients
- Polynomial can also be represented as
arbitrary points such that
- Transformation from coefficients to points takes
time - Transformation from points to coefficients also takes
time, this is to be proved in HWs
Fast Fourier Transformation (FFT) definition
An algorithm for performing transformations between coefficients and points representations in
Karatsuba algorithm definition
An algorithm for performing polynomial multiplication in
Generalization
First solution
Fill
Second solution
Naive multiplication,
Combination of two solutions
Compare
Third solution
Divide
Using polynomial multiplication in the 3-SUM problem
Problem input
Problem output
First solution
Running 2-SUM for each element.
Second solution
Let
This means that
With the limitation of not using the same element twice, we simply check if the coefficient is larger than 1, not just non-zero