I have merged few optimization tricks from geeksforgeeks(I couldn't find the blog link while creating this repository) and few other programmers that I know(I am not sure the optimization tricks are their own). So the final code ended up like this. And this is the most optimized version I've known so far. If you can optimize it more feel free to contribute.
Right now the complexity of the code is O(N). This doesn't even need 2N iterations. Mind that this code is written in C++. You can contribute to this repository by adding codes in C/Python/Java of this optimized sieve.
-
Notifications
You must be signed in to change notification settings - Fork 1
License
tanimahossain/Optimized-Sieve
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published