Standard C++ Library Class Reference
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
prev_permutation
Algorithm
Summary
Generate successive permutations of a sequence based on an ordering function.
Contents
Synopsis●
Description●
Complexity●
Example●
Warning●
See Also●
Synopsis
#include <algorithm>
template <class BidirectionalIterator>
bool prev_permutation (BidirectionalIterator first,
BidirectionalIterator last);
template <class BidirectionalIterator, class Compare>
bool prev_permutation (BidirectionalIterator first,
BidirectionalIterator last, Compare comp);
Description
The permutation-generating algorithms (next_permutation and prev_permutation) assume that
the set of all permutions of the elements in a sequence is lexicographically sorted with respect to
operator< or comp. So, for example, if a sequence includes the integers 1 2 3, that sequence has