// This programs generates all permutations of length L // using characters of set A. The set A is represented as // array of characters. It is generated from the string read // from comand line. There are two input parameters from command line: // The first string correspond to array A, and the second string correspond to // length L. Please make sure that the string has no repetition of characters // and its length is at least equal to L. // For example for paramaters abcd 4, the out put is // 24 permutations of {a,b,c,d}. // class permutation { public static void swap(char[] A, int i, int j) { char temp = A[i]; A[i] = A[j]; A[j] = temp; } public static void PermuteS(char[] A, int i, int L, String S) { if(L==0) System.out.println(S); else for(int j = i; j