您的位置:首页 > 其它

determinded if a number is a prime

2016-03-21 22:04 225 查看
1. alorighm one : by uisng the defination of the prime. scanf the 2---n-1,

improving :traveral 2-sqrt(n).

2.alorighm two ;find the prime, and set a list(array) to save it .when you need to judgment

wether the number is prime . find the list .

there are two problem need to solve :

1. you need to get a efficent way to find prime.(快速筛选法)

1.is _prime[i]=ture; 2. start with 2--sqrt(n)

2.reduce the size of the prime list.(位图数据结构)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: