这是最快的算法来寻找素数? [英] Which is the fastest algorithm to find prime numbers?
本文介绍了这是最快的算法来寻找素数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是最快的算法,找出使用C ++素数?我已经用筛子的算法,但我还是希望它更快!
Which is the fastest algorithm to find out prime numbers using C++? I have used sieve's algorithm but I still want it to be faster!
推荐答案
一个非常快速的实现阿特金的筛是丹·伯恩斯坦的 primegen 。该筛比筛的效率更高。他的网页有一定的基准信息。
A very fast implementation of the Sieve of Atkin is Dan Bernstein's primegen. This sieve is more efficient than the Sieve of Eratosthenes. His page has some benchmark information.
这篇关于这是最快的算法来寻找素数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文