Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about sieve-of-eratosthenes

Read more about sieve-of-eratosthenes

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - sieve-of-eratosthenes

SML Sieve of Eratosthenes

I am new to SML. I am trying to create a function that outputs a list of all prime numbers which are smaller than or equal to a given integer n > 2 using the Sieve of Eratosthenes. I am running int...
test-img

Melty

function

primes

sml

smlnj

sieve-of-eratosthenes

Votes: 0

Answers: 1

Latest Answer

Your removeMult function works nicely. Your sieve function works perfectly too. Too perfectly. Consider what happens when you call dosieve(10) for instance: dosieve(10) sieve(createList(9), []) sieve(...
test-img

Chris

Optimized Summation of all prime numbers under N

There was 10th question in project eular. The problem is to find the sum of all prime numbers not greater than N. My soln for the problem is : int solve(int n){ bool check[n+1]; for(int i=0;i...
test-img

NITISH PANDEY

c++

algorithm

primes

sieve-of-eratosthenes

Votes: 0

Answers: 2

Latest Answer

You have T up to 10^4 (number of tests), and for each of them you run your solve() from start. Just run solve() one time for maximal possible n and save results of check and sums array into global var...
test-img

Arty

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved