Combination相关集合

package w3ang.algorithms;
import java.util.ArrayList;
public class Combination
{
	public static void main(String[] args) {
		ArrayListarrayList=new ArrayList<>();
		arrayList.add(1);arrayList.add(2);arrayList.add(3);arrayList.add(4);
		Combination combination=new Combination();
		combination.listCombineAll(arrayList, new String(), 0, arrayList.size());
	}
	
	void listCombineAll(ArrayListar,String result, int s,int t)
	{
		//#对应的对
		System.out.print("#: ");System.out.print("[#,#] ");
		listSonCombine(ar, "#",result, 0, ar.size());
		System.out.println();
		
		//非空组合对应的对
		listCombine(ar, result, s, t);
	}
	
	void listCombine(ArrayListar,String result, int s,int t)
	{
		for(int i=s;iarSon=(ArrayList) ar.clone();
			System.out.print("["+new_result+","+new_result+"] ");
			for(int j=0;jar,String originResult, String result, int s,int t)
	{
		for(int i=s;i

你可能感兴趣的:(Algorithms)