public class Utils { private static
void swap(ArrayList data, int i, int j) { T t = data.get(i); } public static > boolean nextPerm(ArrayList data) { // find the swaps for (int i = d - 2; i >= 0; i--) if (data.get(i).compareTo(data.get(i + 1)) < 0) { if (data.get(j).compareTo(data.get(s)) < 0 && // public static > ArrayList> Permutations(ArrayList d) { ArrayList> result = new ArrayList>();
Read full article from User:Margusmartsepp/Contributions/Java/Utils.java - Rosetta Code
No comments:
Post a Comment