Common functions in the header file algorithm,

Source: Internet
Author: User

Common functions in the header file algorithm,
Common functions in header file algorithm 1. Non-modified sequence operations (12)

Execute an operation for_each () for each element in the sequence in a loop ()

Find the location where a value appears for the first time in the sequence. find ()

Find the first element find_if () that matches a certain predicate in the sequence ()

Find the find_end () Position of the last occurrence of a subsequence in the sequence ()

Locate the position find_first_of () where the value of the specified value set appears for the first time in the sequence ()

Find an adjacent pair of adjacent_find () in the sequence ()

Count the number of times a value appears in the sequence count ()

Count the number of times in the sequence that matches a certain predicate count_if ()

Compares and finds the first element mismatch () of two different sequences ()

The corresponding elements in the two sequences are both true equal ()

Search for the first occurrence location of a subsequence in the sequence search ()

Locate the position where one value appears n times in the sequence: search_n ()

Ii. Modification sequence operation (27)

Copy from the first element of the sequence ()

Copy copy_backward () from the last element of the sequence ()

Swap ()

Swap_ranges ()

Exchange two elements referred to by the iterator iter_swap ()

Transform applies an operation to each element of the specified range transform ()

Replace () with a given value ()

Replace_if ()

Replace_copy ()

Replace_copy_if ()

Fill with a given value to replace all elements fill ()

Replace the first n elements fill_n () with a given value ()

Generate () replace all elements with the result of one operation ()

Replace the first n elements generate_n () with the result of an operation ()

Delete an element with a given value remove ()

Delete remove_if ()

Remove_copy ()

Remove_copy_if ()

Unique deletion of adjacent duplicate elements unique ()

Delete the adjacent duplicate element unique_copy () during the replication sequence ()

Reverse element order reverse ()

Reverse element order reverse_copy () When copying a sequence ()

Rotate ()

Rotate_copy ()

Random use of even distribution to randomly move the element random_shuffle ()

Divide all elements that meet a certain predicate into the Front partition ()

Put all elements that satisfy a certain predicate in front and maintain the original sequence stable_partition ()

Iii. Sequence sorting and related operations (27)

Sort with good average efficiency sort ()

Sort and maintain the original sequence stable_sort () of the same element ()

Sort the first part of the sequence in the order partial_sort ()

Partial_sort_copy ()

The Nth element places the nth element in its correct position nth_element ()

The first occurrence of lower_bound ()

Find the first occurrence of upper_bound () that is greater than a value ()

Find the maximum range of values that can be inserted to a value (without interrupting the order ()

Determine whether a given element has binary_search () in an ordered sequence ()

Merge and merge two ordered sequences merge ()

Merge two successive ordered sequences inplace_merge ()

When the set operation sequence in the ordered structure is a sub-sequence of another sequence, it is actually des ()

Construct an ordered union of two sets set_union ()

Construct the ordered intersection of two sets set_intersection ()

Construct the ordered difference set set_difference () of Two Sets ()

Construct the ordered symmetric difference set (and-intersection) of two sets set_symmetric_difference ()

Add the element push_heap () to the heap ()

Pop-up element pop_heap () from the heap ()

Construct heap make_heap () from the sequence ()

Sort the heap sort_heap ()

Min (), which is smaller in the maximum and minimum values ()

The larger max () of the two values ()

Min element () in the sequence ()

Max_element (), the largest element in the sequence ()

The dictionary compares the first lexicographical_compare () in the Lexicographic Order of the two sequences ()

Sort the generator in the Lexicographic Order. next_permutation ()

Prev_permutation ()


Reference blog:


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: 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.