Are you trying to give the community a bunch of algorithms ready to use? One suggestion: for each algorithm, your main function seems to be an example of how to call the algorithm. Instead, can you make it take an argument so it can be called from the command line?<p>For example, for the Eratosthenes sieve, your main is:<p><pre><code>    int main()
    {
        sieveOptimized(100);
        for(int j=0;j&lt;100;j++)
    	    if(isPrime[j])
    		 cout &lt;&lt;j &lt;&lt;&quot;\n&quot;;
    } 
</code></pre>
I am suggesting to change it into:<p><pre><code>    int main(int argc, char* args[])
    {
        int n = atoi(args[1]);
        sieveOptimized(n);
        for(int j=0;j&lt;n;j++)
    	    if(isPrime[j])
    		cout &lt;&lt;j &lt;&lt;&quot;\n&quot;;
    }</code></pre>