Skip to content

Latest commit

 

History

History

204.Count-Primes

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

204.Count-Primes

埃拉托斯特尼筛法,简称埃氏筛,是一种由希腊数学家埃拉托斯特尼所提出的一种简单检定素数的算法。 要得到自然数n以内的全部素数,必须把不大于根号n的所有素数的倍数剔除,剩下的就是素数。

埃氏筛的时间复杂度是O(NloglogN)

Leetcode Link