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.

Version:
2.0.2
Author:
ObjectSpace, Inc.
See Also:
ShufflingExamples

Method Index

 o randomShuffle(BidirectionalIterator, BidirectionalIterator)
Shuffle a sequence with uniform distribution by performing as many random swaps as there are elements.
 o randomShuffle(Container)
Shuffle a random access container with uniform distribution by performing as many random swaps as there are elements.

Methods

 o 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.
 o 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