Open pngisnotgif opened 12 years ago
Algorithm in Problem05.py is not so efficient as we can test a prime number for every second integral. Another more efficient way is test every prime number range from 2 to sqrt(n).
Not fully understand. Could you send your version?
In Problem05.py Line 16 to 18.
To test whether a number is a prime:
O(N)--->O( (sqrt(N)/2 )
Algorithm in Problem05.py is not so efficient as we can test a prime number for every second integral. Another more efficient way is test every prime number range from 2 to sqrt(n).