Add linear sieve algorithm#3098
Conversation
|
Nice implementation of linear sieve. |
Thanks for the review!
Please let me know if anything else needs adjustment. |
|
Hi @Panquesito7 and @realstealthninja, When you have some time, could you please review this PR? I’ve updated the linear sieve to follow TheAlgorithms guidelines, and I’d really appreciate your feedback. Thanks a lot! |
|
This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description of Change
This PR adds the linear sieve algorithm to the math folder.
The algorithm finds all prime numbers up to N and calculates the smallest prime factor (SPF) for each number.
This is more efficient than the standard sieve for some applications.
Checklist
Notes
math/linear_sieve.cpp