Mail Archives: djgpp/2000/06/24/16:15:13
Robin Johnson <robbat2 AT home DOT com> writes:
> keep the credits to the code, don't rip it for your homework or something....
>
> /* Quick Prime Finder by Robin Johnson
> 24 June 2000
>
> This uses the sieve of Erosthenes method of finding primes.
> It's a memory hog sometimes. But I believe it's the quickest
> method of finding all the primes up to a particular number,
> as it avoids any recalculation involved in recursive methods.
> It believe it follow an O(n log n) growth. I think some
> problems involved in this, namely the memory it takes up,
> might be solvable by using BitSets or something similar,
> as that could allow a memory saving of approx 8x.
> */
I have an implementation of a bit-set method that I wrote; contact me
if interested.
--
Nate Eldredge
neldredge AT hmc DOT edu
- Raw text -