Translations of this page?:

stable_sort

Syntax:

    #include <algorithm>
    void stable_sort( random_access_iterator start, random_access_iterator end );
    void stable_sort( random_access_iterator start, random_access_iterator end, StrictWeakOrdering cmp );

The stable_sort() algorithm is like the sort() algorithm, in that it sorts a range of elements into ascending order. Unlike sort(), however, stable_sort() will preserve the original ordering of elements that are equal to each other.

Parameters

todo

Return value

todo

Complexity

This functionality comes at a small cost, however, as stable_sort() takes more comparisons that sort() in the worst case: N (log N)^2 instead of N log N.

See also

 
• • • SitemapRecent changesRSScc