Show HN: Data Structures and Algorithms
github.comAre 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?
For example, for the Eratosthenes sieve, your main is:
int main()
{
sieveOptimized(100);
for(int j=0;j<100;j++)
if(isPrime[j])
cout <<j <<"\n";
}
I am suggesting to change it into: int main(int argc, char* args[])
{
int n = atoi(args[1]);
sieveOptimized(n);
for(int j=0;j<n;j++)
if(isPrime[j])
cout <<j <<"\n";
}