TheAlgorithms / C-Sharp

All algorithms implemented in C#.
GNU General Public License v3.0
7.12k stars 1.52k forks source link

SieveOfEratosthenes.cs isn't the Sieve of Eratosthenes #374

Closed deljohnson1 closed 1 year ago

deljohnson1 commented 1 year ago

This is a great project and I would like to help.

I think you should have a prime class and a variety of ways to calculate primes. What is in the SieveOfEratosthenes.cs file is calculating primes by dividing the number by all primes using memoization of previously calculated primes.

https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes

siriak commented 1 year ago

I agree, the current implementation is incorrect. Could you make a PR to fix that?

deljohnson1 commented 1 year ago

Please provide me feedback for the PRs. I am new to github, so hopefully I did it correctly.

siriak commented 1 year ago

You haven't made a PR in this repository yet