Javaでは、ArrayListをシャッフルするには、Collections.shuffle()メソッドが存在することがわかりますが、これはリスト全体をシャッフルします。どのように特定の範囲のArrayListをシャッフルできますか?
にはどうすればメソッドを書くことができます(または誰かがそれを書いて、私にそれを表示することができますか?)次のような:
private ArrayList<AnObject> list;
/**
* Shuffles the concents of the array list in the range [start, end], and
* does not do anything to the other indicies of the list.
*/
public void shuffleArrayListInTheRange(int start, int end)
です。 :) – Malcolm