Algorithm of C ++ standard library

Source: Internet
Author: User
The Header <Algorithm>

Defines a collection of functions especially designed to be used on ranges of elements.

A range is any sequence of objects that can be accessed through
Iterators or pointers, such as an array or an instance of some of the STL containers

.
Notice though, that algorithms operate through iterators directly on
The values, not affecting in any way the structure of any possible
Container (it never affects the size or storage allocation of
Container ).

Functions in <algorithm>

Non-modifying sequence operations

:

For_each

Apply function to range (Template Function)

Find

Find value in range (function template)

Find_if

Find element in range (function template)

Find_end

Find last subsequence in range (function template)

Find_first_of

Find element from set in range (function template)

Adjacent_find

Find equal Adjacent Elements in range (function template)

Count

Count appearances of value in range (function template)

Count_if

Return number of elements in range satisfying condition (function template)

Mismatch

Return first position where two ranges differ (function template)

Equal

Test whether the elements in two ranges are equal (function template)

Search

Find subsequence in range (function template)

Search_n

Find succession of equal values in range (function template)

Modifying sequence operations

:

Copy

Copy range of elements (function template)

Copy_backward

Copy range of elements backwards (function template)

Swap

Exchange Values of two objects (function template)

Swap_ranges

Exchange Values of two ranges (function template)

Iter_swap

Exchange Values of objects pointed by two iterators (function template)

Transform

Apply function to range (function template)

Replace

Replace value in range (function template)

Replace_if

Replace values in range (function template)

Replace_copy

Copy range replacing value (function template)

Replace_copy_if

Copy range replacing value (function template)

Fill

Fill range with value (function template)

Fill_n

Fill sequence with value (function template)

Generate

Generate values for range with function (function template)

Generate_n

Generate values for sequence with function (function template)

Remove

Remove value from range (function template)

Remove_if

Remove elements from range (function template)

Remove_copy

Copy range removing value (function template)

Remove_copy_if

Copy range removing values (function template)

Unique

Remove consecutive duplicates in range (function template)

Unique_copy

Copy range removing duplicates (function template)

Reverse

Reverse range (function template)

Reverse_copy

Copy range reversed (function template)

Rotate

Rotate elements in range (function template)

Rotate_copy

Copy rotated range (function template)

Random_shuffle

Rearrange elements in range randomly (function template)

Partition

Partition range in two (function template)

Stable_partition

Partition range in Two-stable ordering (function template)

Sorting

:

Sort

Sort elements in range (function template)

Stable_sort

Sort elements preserving order of equivalents (function template)

Partial_sort

Partially sort elements in range (function template)

Partial_sort_copy

Copy and partially sort range (function template)

Nth_element

Sort element in range (function template)

Binary Search

(Operating on sorted ranges ):

Lower_bound

Return iterator to lower bound (function template)

Upper_bound

Return iterator to upper bound (function template)

Performance_range

Get subrange of equal elements (function template)

Binary_search

Test if value exists in sorted array (function template)

Merge

(Operating on sorted ranges ):

Merge

Merge sorted ranges (function template)

Inplace_merge

Merge consecutive sorted ranges (function template)

Includes

Test whether sorted range between des another sorted range (function template)

Set_union

Union of two sorted ranges (function template)

Set_intersection

Intersection of two sorted ranges (function template)

Set_difference

Difference of two sorted ranges (function template)

Set_effecric_difference

Semantic Ric difference of two sorted ranges (function template)

Heap

:

Push_heap

Push element into heap range (function template)

Pop_heap

Pop element from heap range (function template)

Make_heap

Make heap from range (function template)

Sort_heap

Sort elements of heap (function template)

Min/MAX

:

Min

Return the lesser of two arguments (function template)

Max

Return the greater of two arguments (function template)

Min_element

Return smallest element in range (function template)

Max_element

Return largest element in range (function template)

Lexicographical_compare

Lexicographical less-than comparison (function template)

Next_permutation

Transform range to next permutation (function template)

Prev_permutation

Transform range to previous permutation (function template)

The specific function will not be translated. the individual's English level is not high. Word http://translate.google.cn
Translate.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.