排列组合

public void permutation (int[] num,int begin){
  
  if(begin==num.length-1){
   //处理事务

  }else{


   for(int i = begin;i                      int c = num[begin];
                     num[begin] = num[i];
                     num[i] = c;
    
                     permutation (num,begin+1);

                     c = num[begin];
                     num[begin] = num[i];
                     num[i] = c;
                 }
        }
 }

 

你可能感兴趣的:(算法)