| Author |
Collections.shuffle question
|
Greg Werner
Ranch Hand
Joined: May 07, 2009
Posts: 54
|
|
|
Does Collections.shuffle() use java.util.Random either as a default or in general? I know the algorithm is Fisher-Yates shuffle, but what the source of randomness is is important to me for the statistical analysis I am doing. Thanks.
|
 |
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
|
|
Greg Werner wrote:Does Collections.shuffle() use java.util.Random either as a default or in general? I know the algorithm is Fisher-Yates shuffle, but what the source of randomness is is important to me for the statistical analysis I am doing. Thanks.
You can find the source code in the src.zip file in your JDK installation.
The answer is yes, but note that there is an overloaded version of shuffle that allows you to supply your own class as the source of randomness (as long as it extends Random).
|
Joanne
|
 |
 |
|
|
subject: Collections.shuffle question
|
|
|