use*_*266 7 algorithm primes
给定整数M.返回小于M的所有素数.
给出尽可能好的算法.需要考虑时间和空间的复杂性.
And*_*per 18
Eratosthenes的Sieve是一个很好的起点.
http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
Way*_*ett 12
一些额外的性能提示:
M
sqrt(M)
2
归档时间:
14 年,10 月 前
查看次数:
23890 次
最近记录:
7 年,2 月 前