@Test
public void test11() {
String str = "abc";
test11_01(str.toCharArray(), 0);
}
public void test11_01(char[] str, int i) {
if (i > str.length) {
return;
} else if (i == str.length - 1) {
System.out.println(Arrays.toString(str));
} else {
for (int j = i; j < str.length; j++) {
char temp = str[j];
str[j] = str[i];
str[i] = temp;
test11_01(str, i + 1);
temp = str[j];
str[j] = str[i];
str[i] = temp;
}
}
}
京公网安备 11010502036488号