Table of Contents
Previous Section Next Section

random_shuffle

template <class RandIter>    void random_shuffle(RandIter start, RandIter end);template <class RandIter, class Generator>
    void random_shuffle(RandIter start, RandIter end,
                        Generator rand_gen);

The random_shuffle( ) algorithm randomizes the sequence defined by start and end.

The second form specifies a custom random number generator. This function must have the following general form:

rand_gen(num);

It must return a random number between zero and num.


Table of Contents
Previous Section Next Section