recursivelyReverse("", "helloWorld");private static void recursivelyReverse(String first, String second) {if (second.length() == 0) {System.out.println(first);return;}for (int index = 0; index < second.length(); index++) {recursivelyReverse(first + second.charAt(index), second.substring(0, index) + second.substring(index + 1));}}
Labels
Recursively print Permutations of a String
Labels:
algorithms
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment