📜  java代码示例中的组合

📅  最后修改于: 2022-03-11 14:52:07.385000             🧑  作者: Mango

代码示例1
private void helper(List combinations, int data[], int start, int end, int index) {    
  if (index == data.length) {        
    int[] combination = data.clone();        
    combinations.add(combination);    
  } 
  else if (start <= end) {        
    data[index] = start;        
    helper(combinations, data, start + 1, end, index + 1);        
    helper(combinations, data, start + 1, end, index);    
  }
}