List of utility methods to do Permute
ArrayList | permutationBuilder(ArrayList permutation Builder ArrayList<ArrayList<Integer>> listOfNewPerm = new ArrayList<ArrayList<Integer>>(); for (int i = 0; i <= curList.size(); i++) { ArrayList<Integer> k = new ArrayList<Integer>(curList); k.add(i, next); listOfNewPerm.add(k); return listOfNewPerm; |
ArrayList | permutationBuilder2(ArrayList permutation Builder ArrayList<ArrayList<Integer>> listOfAllPerm = new ArrayList<ArrayList<Integer>>(); for (int i = 0; i < inputArray.size(); i++) { ArrayList<ArrayList<Integer>> listOfNewPerm = permutationBuilder(inputArray.get(i), k); for (int j = 0; j < listOfNewPerm.size(); j++) { listOfAllPerm.add(listOfNewPerm.get(j)); return listOfAllPerm; ... |
List | permute(Iterable permute List<File> r = new ArrayList<>(); for (File file : files) { int i = rand.nextInt(r.size() + 1); if (i == r.size()) { r.add(file); } else { r.add(r.get(i)); r.set(i, file); ... |