Pergunta

Which is the best way to do polynomial powers? Is it by following the multinomial theorem (wikipedia) which takes O(?) or by FFT (fast Fourier transformation) and then inverse FFT with O((N*log(N))^2)?

Foi útil?

Solução

FFT if you need to do it frequently, or on large polynomials. The naive multiplication algorithm is O(N^2), while FFT is O(N log(N)).

Here is a much better explanation with some neat applications: JeffE FFT

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top