@@ -0,0 +1,957 @@
+package coding4fun;%0A%0A/**%0A * List all permutations of a given string.%0A *%0A * %3Cpre%3E%0A * Input : ABC%0A * Output:%0A * ABC%0A * ACB%0A * BAC%0A * BCA%0A * CBA%0A * CAB%0A * %3C/pre%3E%0A */%0Apublic class Problem32 %7B%0A    private static void permutation(String str) %7B%0A        char%5B%5D chars = str.toCharArray();%0A        permutation(chars, 0, chars.length);%0A    %7D%0A%0A    private static void permutation(char%5B%5D chars, int left, int right) %7B%0A        if (left == right) %7B%0A            System.out.println(new String(chars));%0A            return;%0A        %7D%0A        for (int i = left; i %3C right; i++) %7B%0A            char tmp = chars%5Bleft%5D;;%0A            chars%5Bleft%5D = chars%5Bi%5D;%0A            chars%5Bi%5D = tmp;%0A            permutation(chars, left + 1, right);%0A            // backtrack to revert the original list%0A            tmp = chars%5Bleft%5D;;%0A            chars%5Bleft%5D = chars%5Bi%5D;%0A            chars%5Bi%5D = tmp;%0A        %7D%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        permutation(%22ABC%22);%0A    %7D%0A%7D%0A

Add problem 32