Java List Permutate permutation(String prefix, String s, List list)

Here you can find the source of permutation(String prefix, String s, List list)

Description

permutation

License

Open Source License

Declaration

private static void permutation(String prefix, String s, List<String> list) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    private static void permutation(String prefix, String s, List<String> list) {
        int n = s.length();
        if (n == 0) {
            list.add(prefix);//from  w w w  . ja va  2s  . co m
        } else {
            for (int i = 0; i < n; i++) {
                permutation(prefix + s.charAt(i), s.substring(0, i) + s.substring(i + 1, n), list);
            }
        }
    }
}

Related

  1. perm(List l)
  2. permsList(List topList)
  3. permutate(List src)
  4. permutation(List list1, List list2, String token)
  5. permutations(List list)
  6. permutations(List listings)
  7. permutations(Map> parameterValues)
  8. permute(List s1, List s2)