Algorithm-2: Divide-and-Conquer

Notes on algorithms and complexity. Divide-and-conquer

Chapter 2. Divide-and-Conquer Algorithms

Recurrence relations

Master theorem:

for some constants (a>0) , (b>1) ,and (d ≥0) , then

d is the exponent of the time complexity of the non-recursive part (i.e., the work done outside each recursive call).

Example: the divide-and-conquer algorithm for integer multiplication

FFT

Basic idea: use divide-and-conquer to bring the complexity of the polynomial multiplication algorithm down to O(n logn)

Concrete implementation: borrowing the point-value representation of polynomials (n+1 points determine a degree-n polynomial), multiplication can be done in O(n), so convert the polynomial multiplication into a multiplication in the point-value representation and then convert back to the original coefficient representation

The FFT formula:

We design the fast Fourier transform (FFT), which converts coefficients to values in time, where the points are the complex (n)-th roots of unity:

That is:

The fast Fourier transform (FFT) multiplies an arbitrary (n)-dimensional vector (i.e., the coefficient representation) by the (n \times n) matrix:

The (j, k)-th entry of the matrix (counting from zero) is .

Inverse formula:

A detailed explanation of the fast Fourier transform


Translated from the Chinese original.

Welcome to my other publishing channels

中文