Class FisherYatesShuffle
Performs Durstenfeld's Fisher–Yates shuffle algorithm to randomize collections.
Inherited Members
Namespace: Rebus.Server
Assembly: Rebus.Server.dll
Syntax
public class FisherYatesShuffle
Remarks
The implementation of this class was inspired by and based on this Wikipedia article.
Constructors
FisherYatesShuffle(Random)
Initializes a new instance of the FisherYatesShuffle class.
Declaration
public FisherYatesShuffle(Random random)
Parameters
Type | Name | Description |
---|---|---|
Random | random | The pseudo-random number generator. |
Properties
Random
Gets the pseudo-random number generator.
Declaration
public Random Random { get; }
Property Value
Type | Description |
---|---|
Random | The pseudo-random number generator. |
Methods
Shuffle(IList<String>)
Shuffles a collection using Durstenfeld's algorithm.
Declaration
public void Shuffle(IList<string> values)
Parameters
Type | Name | Description |
---|---|---|
IList<String> | values | The collection. |