From 969a09701a2508c510ffacc8e4af5ee5c9b23615 Mon Sep 17 00:00:00 2001 From: tej munnisa begum Date: Thu, 4 Jul 2024 17:22:34 +0530 Subject: [PATCH] remove the duplicate one SieveofErathosthenesIntArray.js --- Maths/SieveOfEratosthenesIntArray.js | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 Maths/SieveOfEratosthenesIntArray.js diff --git a/Maths/SieveOfEratosthenesIntArray.js b/Maths/SieveOfEratosthenesIntArray.js deleted file mode 100644 index 56336ce7d8..0000000000 --- a/Maths/SieveOfEratosthenesIntArray.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Function to get all prime numbers below a given number - * This function returns an array of prime numbers - * @see {@link https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes} - */ - -function sieveOfEratosthenes(max) { - const sieve = [] - const primes = [] - - for (let i = 2; i <= max; ++i) { - if (!sieve[i]) { - // If i has not been marked then it is prime - primes.push(i) - for (let j = i << 1; j <= max; j += i) { - // Mark all multiples of i as non-prime - sieve[j] = true - } - } - } - return primes -} - -export { sieveOfEratosthenes }