알고리즘

    재귀

    재귀 (Recurssion) 함수 내부에서 직접 혹은 간접적으로 자기 자신을 호출 Base Part : 재귀를 끝나는 조건을 지닌 파트 Inductive Par : 자기 자신을 호출하는 파트 재귀의 호출은 프로그램 메모리 구조에서 스택을 사용하기 때문에, 반복적인 호출은 메모리 및 속도의 성능 저하를 야기한다. 예제 팩토리얼 int factorial(int n){ if (n==1 || 0) return 1; else return n*factorial(n-1); } Permutation public class PermutationTest { static int N =3, R =4; static int[] numbers; static int[] input; static boolean[] isSelected;..