问题
I am trying to find the complexity of a factorization for big numbers. Which is the best algorithm and which is the complexity of finding a number's prime factors? Assume that the length of the number is n.
回答1:
The best know algoritm for factoring integer larger than 100 digits is General number field sieve. It's complexity is explained on the page that the link links to.
Wikipedia has a nice article about other algoritms: http://en.wikipedia.org/wiki/Integer_factorization
回答2:
the complexity will be sqrt(n)log(n).But for n<=19^7 if you use sieve then after sieve it can be done in log(n). You can see here -> http://codeforces.com/blog/entry/7262
来源:https://stackoverflow.com/questions/10564153/prime-factorization-for-big-numbers