public class SattoloShuffle<T extends java.lang.Comparable> extends java.lang.Object implements ShufflingEngine<T>
FisherYatesKnuthShuffle
produces a random permutation while SattoloShuffle
produces a random permutation with exactly one cycle. i.e. we do not allow an element to be
swapped with itself, which implies an element will never end-up in it's original position.
ARRAY_IS_EMPTY, DATA_TYPE_NOT_SUPPORTED_YET, DECIMAL_RADIX, DELIMITER_COMMA, ELEMENT_NOT_FOUND, LIST_IS_EMPTY, OPERATION_NOT_SUPPORTED_YET
Constructor and Description |
---|
SattoloShuffle() |
Modifier and Type | Method and Description |
---|---|
void |
shuffle(T[] objects) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRandomNumberInRange
checkArray, checkIntArray, checkList
public void shuffle(T[] objects)
shuffle
in interface ShufflingEngine<T extends java.lang.Comparable>