TheAlgorithms / JavaScript

Algorithms and Data Structures implemented in JavaScript for beginners, following best practices.
https://the-algorithms.com/language/javascript
GNU General Public License v3.0
32.17k stars 5.51k forks source link

[OTHER]: Duplicate entry of sieve of eratosthenes #1666

Open SpiderMath opened 4 months ago

SpiderMath commented 4 months ago

What would you like to share?

There's three entries in total for Sieve of Eratosthenes on the website, but the problem is that there's a primary one out of the three which has a majority of the implementations, including that of JS. However, there's another one which has just another JS implementation of the exact same thing, and it's named Sieve of Eratosthenes Int Array, which is both a weird name and just a random duplicate entry. Since it only had a JS entry, I wasn't sure if I should open an issue on the website repo or here, hence I thought as this was a JS repo issue I'd open it here. So, do we remove the duplicate entry from the repository?

Additional information

No response

appgurueu commented 4 months ago

I think we can get rid of https://github.com/TheAlgorithms/JavaScript/blob/master/Maths/SieveOfEratosthenesIntArray.js; it is strictly inferior to https://github.com/TheAlgorithms/JavaScript/blob/master/Maths/SieveOfEratosthenes.js (except perhaps for being a bit simpler, at the cost of being less optimized).

SpiderMath commented 4 months ago

Since you've added the beginner-friendly tag, do you wish to keep this issue open for any beginners to take it up or should I do it now and push the changes? (considering we only need to remove certain files)

appgurueu commented 4 months ago

Since you've added the beginner-friendly tag, do you wish to keep this issue open for any beginners to take it up or should I do it now and push the changes? (considering we only need to remove certain files)

Feel free to do it now

AbhishekMane06 commented 2 months ago

There are three entries for the Sieve of Eratosthenes on the website, with one primary entry containing most implementations, including JavaScript. However, there's another entry named "Sieve of Eratosthenes Int Array," which is a duplicate with only a JavaScript implementation and a confusing name.

Please review and confirm if this is a suitable approach.

PranjalShrivas commented 2 months ago

There are two Sieve of Eratosthenes entries in the website ( I think they are duplicate ). It returns an array of boolean which tells the numbers are true or false.

There is another one Sieve of Eratosthenes Int Array it return the Array of numbers that are primes only and it doesn't contains any non prime numbers.

I think Sieve of Eratosthenes Int Array should not be removed, while out of two Sieve of Eratosthenes entries one should be removed because I think they are duplicate. Please tell if I am in right direction.

appgurueu commented 2 months ago

As I said, I think removing the "Int Array" variant is fine. Then there is only one Sieve of Eratosthenes left.

raklaptudirm commented 2 months ago

There is a pr with the necessary change, but they seem to have abandoned it without removing the related tests.

shah0108 commented 12 hours ago

is this issue still on??