文章列表
public class ArrayPermutation {
public static void main(String[] args) {
char[] str = {'a','b','c','d'};
dopa(str,str.length);
}
/*
* 对数组a的第0到第n-1项进行全排列
*/
public static void dopa(char[]a,int n){
if(n==1){//如果n为1,则无需再进行全排列,此时应该输出数组了
printArray(a);//打印数组
//return ...
public class InsertSort {
public static void main(String[] args) {
int[] old = {1,3,3,67,214234,34,9,34314,56,1};
sort(old);
print(old);
}
public static void sort(int[] a){
for(int i=1;i<a.length;i++){
int temp = a[i];
int inner = i;
while(temp<a[inner-1] ...