[알고리즘] 순열 / 중복순열 / 조합 / 중복조합
순열 서로 다른 n개 중 r개를 뽑아서 정렬 하는 것 즉, 순서가 있어 순서가 다르면 다른 것으로 카운팅함 AB != AB // int[] arr : 원본 배열 // int[] out : 출력 배열 // boolean[] visited : 방문체크 // int depth : 현재 탐색중인 인덱스 // int r : 뽑고자 하는 개수 public class 순열 { public static void main(String[] args){ int[] arr = {1, 2, 3}; int r = 2; permutation(arr, new int[r], new boolean[arr.length], 0, r); } public static void permutation(int[] arr, int[] out, boo..