Program for all permutations of given string
Anonymous
public static Sect permute(String str) { Set Perm = new Hashset(); if(Str==null || Str =="") { perm.add("") return perm } else String initial = Str.charAt(0); String substr = Str.substring(1); Setword = permute(substr ); for(String snew word) { for(int i =0;i Perm = permute(s); for(String s1 :Perm) sysout(s1); }
Check out your Company Bowl for anonymous work chats.