Project C#

Job ID: 33700431

Budget: €8 – €30 EUR

The following implementation of the algorithm of testing whether a given number is prime is given:


bool Jestpierwsza(int Num)
{
if (Num < 2) return false;
else if (Num < 4) return true;
else if (Num % 2 == 0) return false;
else for (int u = 3; u < Num / 2; u += 2)
if (Num % u == 0) return false;
return true;
}
=======================================================
The aim of the project is to propose a more efficient algorithm (linear sieve algorithm) while keeping the subroutine interface unchanged.
Perform analysis using time measurements.
Assume that the dominant operation is division modulo (%).

In the report, present for both algorithms:

• the source code of both algorithms

• TXT result file for the first algorithm

• TXT result file for the second algorithm

• the collected results in the form of text and graphs

• conclusions from the analysis of the collected data (complexity assessment)