알고리즘 타파/Algorithm
-
다이나믹 프로그래밍 (Dynamic Programming)알고리즘 타파/Algorithm 2020. 9. 6. 21:59
참고 https://ko.wikipedia.org/wiki/%EC%B5%9C%EB%8C%80%EA%B3%B5%EC%95%BD%EC%88%98ko.wikipedia.org/wiki/%EB%8F%99%EC%A0%81_%EA%B3%84%ED%9A%8D%EB%B2%95 동적 계획법 - 위키백과, 우리 모두의 백과사전 위키백과, 우리 모두의 백과사전. 수학과 컴퓨터 과학, 그리고 경제학에서 동적 계획법(動的計劃法, dynamic programming)이란 복잡한 문제를 간단한 여러 개의 문제로 나누어 푸는 방법을 말한다. 이� ko.wikipedia.org 정의 큰 문제를 작은 문제로 나눠서 푸는 알고리즘 두 가지 방법으로 문제를 해결할 수 있다. Top-down Bottom-up 다이나믹 프로그래밍에서는 구하는..
-
소인수분해 (Prime Factorization)알고리즘 타파/Algorithm 2020. 7. 14. 00:16
참고 https://ko.wikipedia.org/wiki/%EC%86%8C%EC%9D%B8%EC%88%98%EB%B6%84%ED%95%B4 소인수분해 - 위키백과, 우리 모두의 백과사전 위키백과, 우리 모두의 백과사전. 둘러보기로 가기 검색하러 가기 소인수분해(영어: prime factorization, integer factorization)는 합성수를 소수의 곱으로 나타내는 방법을 말한다. 소인수분해를 일의적�� ko.wikipedia.org 정의 정수 N을 소수의 곱으로 분해 방법 N을 소인수분해 할 때, 가장 큰 값이 되는 경우는 루트 N이다. 2부터 루트 N까지 N을 나눌 수 없을 때까지 계속 나눈다. for (int i=2; i*i 1) { System.out.printf("%d\n", in..
-
팩토리얼 (Factorial)알고리즘 타파/Algorithm 2020. 5. 30. 10:53
참고 https://ko.wikipedia.org/wiki/%EA%B3%84%EC%8A%B9 계승 - 위키백과, 우리 모두의 백과사전 위키백과, 우리 모두의 백과사전. 계승(繼承)에 대해서는 왕위 계승 문서를 참조하십시오. 수학에서, 자연수의 계승 또는 팩토리얼(階乘, 문화어: 차례곱, 영어: factorial)은 그 수보다 작거나 같은 ko.wikipedia.org 정의 N! = 1*2*...*N 팩토리얼을 구하는 방법 1) 반복문을 통해 하나하나 곱하는 방법 long result = 1; if(N
-
골드바흐의 추측 (Goldbach's conjecture)알고리즘 타파/Algorithm 2020. 5. 30. 01:41
참고 https://ko.wikipedia.org/wiki/%EA%B3%A8%EB%93%9C%EB%B0%94%ED%9D%90%EC%9D%98_%EC%B6%94%EC%B8%A1 골드바흐의 추측 - 위키백과, 우리 모두의 백과사전 위키백과, 우리 모두의 백과사전. 골드바흐의 추측(Goldbach's conjecture)은 오래전부터 알려진 정수론의 미해결 문제로, 2보다 큰 모든 짝수는 두 개의 소수(Prime number)의 합으로 표시할 수 있다는 것� ko.wikipedia.org 정의 2보다 큰 모든 짝수는 두 소수의 합으로 표현 가능하다.
-
소수 (Prime Number)알고리즘 타파/Algorithm 2020. 5. 29. 22:35
참고 https://ko.wikipedia.org/wiki/%EC%86%8C%EC%88%98_(%EC%88%98%EB%A1%A0) 소수 (수론) - 위키백과, 우리 모두의 백과사전 위키백과, 우리 모두의 백과사전. 좌측은 소수, 우측은 합성수. 소수란 자신보다 작은 두 자연수를 곱하여 만들 수 없는 1보다 큰 자연수이다. 소수(素數, 발음: [소쑤], 문화어: 씨수, 영어: prime nu ko.wikipedia.org 정의 약수가 1과 자기 자신밖에 없는 수 어떤 수 N이 소수가 되려면, 2보다 크거나 같아야 하고, N-1보다 작거나 같은 수로 나누어떨어지면 안 된다. 예) 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97 소..
-
최소공배수 (Least Common Multiple)알고리즘 타파/Algorithm 2020. 5. 29. 22:06
참고 https://ko.wikipedia.org/wiki/%EC%B5%9C%EC%86%8C%EA%B3%B5%EB%B0%B0%EC%88%98 최소공배수 - 위키백과, 우리 모두의 백과사전 위키백과, 우리 모두의 백과사전. 수론에서, 여러 개의 정수/다항식/환의 원소의 공배수(公倍數, 영어: common multiple)는 그들 모두의 배수가 되는 정수/다항식/환의 원소이다. 최소공배수(最小公倍 ko.wikipedia.org 정의 두 수의 공통된 배수 중에서 가장 작은 정수 최소공배수를 구하는 방법 두 수의 최대공약수를 활용한다. A, B의 최대공약수가 G일때, 최소공배수는 = G * (A/G) * (B/G)
-
최대공약수 (Greatest Common Divisor)알고리즘 타파/Algorithm 2020. 5. 29. 21:59
참고 https://ko.wikipedia.org/wiki/%EC%B5%9C%EB%8C%80%EA%B3%B5%EC%95%BD%EC%88%98 최대공약수 - 위키백과, 우리 모두의 백과사전 위키백과, 우리 모두의 백과사전. 수론에서, 정수들의 공약수(公約數, 영어: common divisor)는 동시에 그들 모두의 약수인 정수다. 적어도 하나가 0이 아닌 정수들의 최대공약수(最大公約數, 문화어: ko.wikipedia.org 정의 두 수 A, B의 공통된 약수 중에서 가장 큰 정수 최대공약수가 1인 두 수를 서로소(Copreme)라고 한다. 최대공약수를 구하는 방법 1) 2부터 A, B중 작은 수까지 모든 정수로 나누어 보는 방법 int g = 1; for (int i=2; i