determinded if a number is a prime

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.(位图数据结构)

posted @ 2016-03-21 22:04  G++  阅读(307)  评论(0编辑  收藏  举报