Algorithm/Algorithm
순열 (Permuation)
순열 순열은 서로 다른 n개의 값 중에서 r개의 숫자를 뽑는 경우의 수를 의미한다. static int K; static int[] arr, result; static boolean[] visited; // 순열 public static void main(String[] args) { arr = new int[]{1, 2, 3}; K = 2; // 뽑는 개수 result = new int[K]; visited = new boolean[arr.length]; //배열의 개수만큼 초기화 permutation(0); } public static void permutation(int cnt) { if (cnt == K) { System.out.println(Arrays.toString(result)); retu..