@@ -0,0 +1,1093 @@
+package com.anuragkapur.pie.recursion;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * @author anuragkapur%0A */%0Apublic class Permutations %7B%0A%0A    public List%3CString%3E getPermutations(String str) %7B%0A%0A        if (str == null) %7B%0A            return null;%0A        %7D%0A%0A        List%3CString%3E permutations = new ArrayList%3C%3E();%0A        if (str.length() == 1) %7B%0A%0A            permutations.add(str);%0A        %7D else %7B%0A%0A            char chars%5B%5D = str.toCharArray();%0A            for (int i = 0; i %3Cchars.length; i++) %7B%0A%0A                String prefix = String.valueOf(chars%5Bi%5D);%0A                StringBuilder remainder = new StringBuilder();%0A                for (int j = 0; j %3Cchars.length; j++) %7B%0A                    if (j != i) %7B%0A                        remainder.append(chars%5Bj%5D);%0A                    %7D%0A                %7D%0A%0A                List%3CString%3E subPermutations = getPermutations(remainder.toString());%0A                for (String subPerm : subPermutations) %7B%0A                    permutations.add(prefix+subPerm);%0A                %7D%0A            %7D%0A        %7D%0A%0A%0A        return permutations;%0A    %7D%0A%7D%0A

Add algo to compute string permutations