| 1 | public class FindPermutations { |
| 2 | |
| 3 | public static void findPermutation(String str, String ans) { |
| 4 | if(str.length() == 0) { |
| 5 | System.out.println(ans); |
| 6 | return; |
| 7 | } |
| 8 | |
| 9 | for(int i=0; i<str.length(); i++) { |
| 10 | char pickedChar = str.charAt(i); |
| 11 | String restStr = str.substring(0,i) + str.substring(i+1); |
| 12 | findPermutation(restStr, ans+pickedChar); |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | public static void main(String args[]) { |
| 17 | String str = "aa"; |
| 18 | findPermutation(str, ""); |
| 19 | } |
| 20 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…