public class Knuth extends 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(String[] args)
Reads in a sequence of strings from standard input, shuffles
them, and prints out the results.
|
static void |
shuffle(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(Object[] a)
a - the array to be shuffledStdRandompublic static void main(String[] args)
Copyright © 2014. All Rights Reserved.