public class Knuth extends java.lang.Object
For additional documentation, see Section 1.1 of Algorithms, 4th Edition, by Robert Sedgewick and Kevin Wayne.
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Reads in a sequence of strings from standard input, shuffles
them, and prints out the results.
|
static void |
shuffle(java.lang.Object[] a)
Rearranges an array of objects in uniformly random order
(under the assumption that Math.random() generates independent
and uniformly distributed numbers between 0 and 1).
|
public static void shuffle(java.lang.Object[] a)
a
- the array to be shuffledStdRandom
public static void main(java.lang.String[] args)