/* Copyright (c) <2009> * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely */ // Find the primes numbers in the first n integers using The Sieve Of Eratosthenes public class sieves { public sieves (int n) { new int [n]; /* int[] m_data = new int [n]; //Initialize the first n integer array for (int i = 0; i < n; i ++) { m_data[i] = i; } // apply Eratosthenes algorithm for(int i = 2; i < n; i = i + 1) if(m_data[i]) for(int j = i; j * i < n; j = j + 1) //mark all integers who are multiple of i m_data[j * i] = 0; */ } // int[] m_data; }