List of utility methods to do ArrayList Shuffle
ArrayList | shuffle(ArrayList l) shuffle long seed = System.nanoTime(); Collections.shuffle(l, new Random(seed)); return l; |
ArrayList | shuffle(ArrayList shuffle ArrayList<T> newList = new ArrayList<T>(); ArrayList<T> ret = new ArrayList<T>(); newList.addAll(population); Collections.shuffle(newList); ret.addAll(newList); for (int i = sample; i < ret.size(); i++) { ret.remove(i); i--; ... |