All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.rubin.util.Shuffling

java.lang.Object
   |
   +----CH.rubin.util.Shuffling

public final class Shuffling
extends Object
The Shuffling class contains generic shuffling algorithms.

Version:
2.0.2
Author:
ObjectSpace, Inc., Patrick Feisthammel email: pafei@rubin.ch
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.
 o setSeed(long)
Set the seed which will be use for shuffling.

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.
 o setSeed
 public static void setSeed(long seed)
Set the seed which will be use for shuffling.

Parameters:
seed - the seed to be set

All Packages  Class Hierarchy  This Package  Previous  Next  Index