Functions in the #include <algorithm>

Source: Internet
Author: User

Functions in the #include <algorithm>

#include <algorithm>
  Non-modified sequence operations (12)
Cycle Perform an action on each element in a sequence For_each ()
Find Find the first occurrence of a value in a sequence Find ()
Find the first element in a sequence that conforms to a predicate Find_if ()
Find the last occurrence of a subsequence in a sequence Find_end ()
Find the first occurrence of a value in a specified set of values in a sequence Find_first_of ()
Finding adjacent pairs of values in a sequence Adjacent_find ()
Count Count the number of occurrences of a value in a sequence Count ()
Count the number of times a predicate is matched in a sequence Count_if ()
Comparison Find the first element that is different from the two sequence Mismatch ()
The corresponding elements in the two sequence are both true Equal ()
Search Find the first occurrence of a sub-sequence in a sequence Search ()
Find the position of successive n occurrences of a value in a sequence Search_n ()
  Modified sequence Action (27)
Copy Copy from the first element of a sequence Copy ()
Copy from the last element of a sequence Copy_backward ()
Exchange Exchange of two elements Swap ()
Swaps the elements of a specified range Swap_ranges ()
Swaps two elements that are referred to by iterators Iter_swap ()
Transform Apply an action to each element of a specified range Transform ()
Replace Replace some values with a given value Replace ()
Replace some elements that satisfy a predicate Replace_if ()
Replace an element with a given value when copying a sequence Replace_copy ()
To replace an element that satisfies a predicate when copying a sequence Replace_copy_if ()
Fill Replace all elements with a given value Fill ()
Replaces first n elements with a given value Fill_n ()
Generated Replace all elements with the result of one operation Generate ()
Replace the first n elements with the result of one operation Generate_n ()
Delete Delete an element with a given value Remove ()
Delete an element that satisfies a predicate Remove_if ()
Delete an element with a given value when copying a sequence Remove_copy ()
Deleting an element that satisfies a predicate when copying a sequence Remove_copy_if ()
Only Delete adjacent repeating elements Unique ()
Delete adjacent repeating elements when copying a sequence Unique_copy ()
Reverse Reverse the order of elements Reverse ()
Reverses the order of elements when copying a sequence Reverse_copy ()
Ring shift Loop moving elements Rotate ()
Looping elements while copying a sequence Rotate_copy ()
Random Use uniform distribution to move elements randomly Random_shuffle ()
Divided Put the elements that satisfy a predicate in front Partition ()
Puts the elements that satisfy a predicate in front and maintains the original order Stable_partition ()
  Sequence sequencing and related operations (27)
Sort Sort by a good average efficiency Sort ()
Sort, and maintain the original order of the same elements Stable_sort ()
Order the first part of a sequence Partial_sort ()
The first part of the sequence is ordered at the same time as the copy Partial_sort_copy ()
Nth element Place the nth element in its correct position Nth_element ()
Two-point Search Find first occurrence greater than or equal to a value Lower_bound ()
Find the first occurrence greater than a value Upper_bound ()
Found (without destroying the order) to insert the maximum range of a given value Equal_range ()
Determines whether a given element exists in an ordered sequence Binary_search ()
Merge Merge two ordered sequences Merge ()
Merge two successive sequential sequences Inplace_merge ()
Set operations on an ordered structure True if a sequence is a sub-sequence of another sequence Includes ()
Constructs an ordered set of two sets Set_union ()
Constructs an ordered intersection of two sets Set_intersection ()
Constructing an ordered difference set of two sets Set_difference ()
Constructing an ordered symmetric difference set of two sets (and - intersection) Set_symmetric_difference ()
Heap operations Adding elements to the heap Push_heap ()
Eject elements from the heap Pop_heap ()
Constructing a heap from a sequence Make_heap ()
To sort the heap Sort_heap ()
Maximum and minimum The smaller of the two values Min ()
The larger of the two values Max ()
The smallest element in a sequence Min_element ()
The largest element in a sequence Max_element ()
Dictionary comparison The first of two sequences by dictionary order in front Lexicographical_compare ()
Permutation generators The next arrangement by dictionary order Next_permutation ()
The previous arrangement by dictionary order Prev_permutation ()

Functions in the #include <algorithm>

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.