All Packages Class Hierarchy This Package Previous Next Index
Class COM.objectspace.jgl.Shuffling
java.lang.Object
|
+----COM.objectspace.jgl.Shuffling
- public final class Shuffling
- extends Object
The Shuffling class contains generic shuffling algorithms.
- See Also:
- ShufflingExamples
-
randomShuffle(BidirectionalIterator, BidirectionalIterator)
- Shuffle a sequence with uniform distribution by performing as many random swaps
as there are elements.
-
randomShuffle(Container)
- Shuffle a random access container with uniform distribution by performing as many
random swaps as there are elements.
randomShuffle
public static void randomShuffle(BidirectionalIterator first,
BidirectionalIterator last)
- Shuffle a sequence with uniform distribution by performing as many random swaps
as there are elements. Time complexity is linear and space complexity is constant.
- Parameters:
- first - An iterator positioned at the first element of the sequence.
- last - An iterator positioned immediately after the last element of the sequence.
randomShuffle
public static void randomShuffle(Container container)
- Shuffle a random access container with uniform distribution by performing as many
random swaps as there are elements. Time complexity is linear and space complexity
is constant.
- Parameters:
- container - The container.
All Packages Class Hierarchy This Package Previous Next Index