알고리즘/알고리즘 개념
[알고리즘] 에라토스테네스의 체(Sieve of Eratosthenes)
에라토스테네스의 체 (Sieve of Eratosthenes) ① 에라토스테네스의 체 (Sieve of Eratosthenes)이란? ▷ 소수 판별 알고리즘입니다.▷ 소수를 대량으로 빠르고 정확하게 구하는 방법입니다. ▷ 소수 : 양의 약수를 두 개만 가지는 자연수입니다.1234567public static boolean isPrimeNumber(int x) { int end = (int) Math.sqrt(x); for(int i = 2; i
2018. 5. 9. 11:37