random_shuffle [C++ Reference]
Keywords: stl,algorithm,random_shuffle
Date: 2009-10-09T01:41:49-0700

[[random_shuffle]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## random_shuffle

Syntax:

        #include <algorithm>
        void random_shuffle( random_iterator start, random_iterator end );
        void random_shuffle( random_iterator start, random_iterator end, RandomNumberGenerator& rnd );

The random_shuffle() function randomly re-orders the elements in the range [start,end). If a random number generator function object rnd is supplied, it will be used instead of an internal random number generator.

The “internal” random number generator is not necessarily the one which can accessed with rand() and seeded with srand(); this is implementation defined. The SGI STL implementation, for example, uses a different generator.

Related Topics: next_permutation, prev_permutation, random_sample, random_sample_n

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •