public class Test {
	
	public static void main(String [] args){
		String[]  array =new String[] {"1","2","3"};
		listAll(Arrays.asList(array), "") ;
	}
	public static void listAll(List canditate,String prefix){
		System.out.println(prefix) ;
		for (int i=0;i<canditate.size();i++){
			List temp = new LinkedList(canditate);
			listAll(temp, prefix+ temp.remove(i)) ;
		}
	}
	
}

结果为

 


1
12
123
13
132
2
21
213
23
231
3
31
312
32
321

相关文章:

  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2022-01-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2021-11-21
相关资源
相似解决方案