permute a string
问题 Given the String, print all its permutations. To do that, i came up with the following program. public static char[] swap(char[] input, int i, int j) { char temp; temp = input[i]; input[i] = input[j]; input[j] = temp; return input; } /** * * @param args */ public static void permuteStrings(char[] inputString, int start, int finish ) { //Base case: When there is only single element, print the string if(start == finish) System.out.println(inputString); else { //Recursive case: Swap first