This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:spring2016:cprog:projects:pnc0 [2016/02/27 13:07] – [Program] wedge | haas:spring2016:cprog:projects:pnc0 [2016/02/27 13:13] (current) – [Program] wedge | ||
---|---|---|---|
Line 123: | Line 123: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | Of particular note: the sieve algorithms take advantage of a increased storage space, where others (like brute force) are predominantly time-based. The sieve is also more detailed... even if you don't decide to implement a sieve, take a look and compare the algorithm to what you've done to see the differences in approaches. | ||
=====Program===== | =====Program===== | ||
It is your task to write 3 separate prime number calculating programs: | It is your task to write 3 separate prime number calculating programs: | ||
- | - primebrute.c: | + | - **primebrute.c**: for your brute force implementation |
- | - primesqrt.c: | + | - **primesqrt.c**: for your square root-optimization of the brute force |
- | - primeopt.c: for your optimized solution, be it basing off the existing ones, or taking a different approach | + | - **primeopt.c**: for your optimized solution, be it basing off the existing ones, or taking a different approach |
Your program should: | Your program should: | ||
Line 136: | Line 139: | ||
* these values should be positive integer values; you can make the assumption that the user will always do the right thing. | * these values should be positive integer values; you can make the assumption that the user will always do the right thing. | ||
* start your stopwatch (see **timing** section below): | * start your stopwatch (see **timing** section below): | ||
- | * perform the correct | + | * perform the algorithm against the value |
* if enabled, display the prime numbers found in the range | * if enabled, display the prime numbers found in the range | ||
* output the processing run-time to STDERR (do this always). | * output the processing run-time to STDERR (do this always). |