| 1 | class Anagram_Rec |
| 2 | { |
| 3 | public static String Anagram(String fix , String s) |
| 4 | { |
| 5 | int l = s.length(); |
| 6 | if(l==1) |
| 7 | { |
| 8 | System.out.println(fix+s); |
| 9 | } |
| 10 | else |
| 11 | { |
| 12 | char ch; |
| 13 | for(int x = 0; x < l; x++) |
| 14 | { |
| 15 | ch = s.charAt(x); |
| 16 | String r = s.substring(0,x)+s.substring(x); |
| 17 | fix = fix+ch; |
| 18 | } |
| 19 | return Anagram(fix , s); |
| 20 | } |
| 21 | return s; |
| 22 | } |
| 23 | public static void main(String args[]) |
| 24 | { |
| 25 | Anagram_Rec ar = new Anagram_Rec(); |
| 26 | System.out.println(ar.Anagram("abc" , "bac")); |
| 27 | } |
| 28 | } |
| 29 |
nothing calls this directly
no outgoing calls
no test coverage detected