Next : Partitions, Previous : Rotate, Top : Table of Contents
random_shuffle (RandomAccessIterator first, RandomAccessIterator last) | Function |
random_shuffle (RandomAccessIterator first, RandomAccessIterator last, RandomNumberGenerator& rand) | Function |
templatevoid random_shuffle(RandomAccessIterator first, RandomAccessIterator last); template void random_shuffle(RandomAccessIterator first, RandomAccessIterator last, RandomNumberGenerator& rand);
random_shuffle shuffles the elements in the range [first, last) with uniform distribution. Exactly (last - first) - 1 swaps are done. random_shuffle can take a particular random number generating function object rand such that rand takes a positive argument n of distance type of the RandomAccessIterator and returns a randomly chosen value between 0 and n-1.
|