C++ STL::Algorithms
for_each
Applies provided function on each element of the range.
generate
Assigns the value returned by successive calls to gen to the elements in the range of first to last.
set_difference
The difference of two sets is formed by the elements that are present in the first set, but not in the second one.
set_intersection
The intersection of two sets is formed only by the elements that are present in both sets.
push_heap
adds an element to a max heap
for_each_n
applies a function object to the first n elements of a sequence
transform
applies a function to a range of elements
transform_reduce
applies a functor, then reduces out of order
generate_n
assigns the results of successive function calls to N elements in a range
all_of
checks if a predicate is true for all of the elements in a range
any_of
checks if a predicate is true for any of the elements in a range
none_of
checks if a predicate is true for none of the elements in a range
is_heap
checks if the given range is a max heap
adjacent_difference
computes the differences between adjacent elements in a range
inner_product
computes the inner product of two ranges of elements
partial_sum
computes the partial sum of a range of elements
set_symmetric_difference
computes the symmetric difference between two sets
partition_copy
copies a range dividing the elements into two groups
rotate_copy
copies and rotate a range of elements
fill_n
copy-assigns the given value to N elements in a range
fill
copy-assigns the given value to every element in a range
reverse_copy
creates a copy of a range that is reversed
unique_copy
creates a copy of some range of elements that contains no consecutive duplicates
make_heap
creates a max heap out of a range of elements
rotate
cycles through vector like it is circular
is_partitioned
determines if the range is partitioned by the given predicate
partition
divides a range of elements into two groups
stable_partition
divides elements into two groups while preserving their relative order
remove
doesn't actually delete elements from the container but only shunts non-deleted elements forwards on top of deleted elements. Used for deleting a range
iota
fills a range with successive increments of the starting value
find_if
finds the first element satisfying specific criteria
mismatch
finds the first position where two ranges differ
is_sorted_until
finds the largest sorted subrange
is_heap_until
finds the largest subrange that is a max heap
nth_element
partially sorts the given range making sure that it is partitioned by the given element
shuffle
randomly re-orders elements in a range
unique
removes consecutive duplicate elements in a range
remove_if
removes elements satisfying specific criteria
pop_heap
removes the largest element from a max heap
replace
replaces all values equaling value with another value
replace_if
replaces all values satisfying specific criteria with another value
upper_bound
returns an iterator to the first element greater than a certain value
lower_bound
returns an iterator to the first element not less than the given value
equal_range
returns range of elements matching a specific key
max
returns the greater of the given values
max_element
returns the largest element in a range
minmax
returns the smaller and larger of two elements
min
returns the smaller of the given values
minmax_element
returns the smallest and the largest elements in a range
min_element
returns the smallest element in a range
reverse
reverses the order of elements in a range
find_first_of
searches for any one of a set of elements
sample
selects n random elements from a sequence
reduce
similar to std::accumulate, except out of order
sort
sorts a range into ascending order
stable_sort
sorts a range of elements while preserving order between equal elements
partial_sort
sorts the first N elements of a range
iter_swap
swaps the elements pointed to by two iterators
swap
swaps the values of two objects
swap_ranges
swaps two ranges of elements
equal
true, if all of the elements in both ranges match; otherwise false
sort_heap
turns a max heap into a range of elements sorted in ascending order
copy
Copies a range of elements to a new location.
find
Finds the first occurrence of the element.
adjacent_find
Finds the first occurrence of two consecutive elements that are identical and returns an iterator pointing to the first element if identical element exists consecutively otherwise returns an iterator pointing to the last element.
find_end
Finds the last occurrence of the element.
count_if
Returns the number of occurrences of value from range that satisfies condition.
count
Returns the number of occurrences of value in range.
accumulate
Sum elements of a vector
includes
Test whether first set is subset of another or not.
is_sorted
Tests whether range is sorted or not.
binary_search
Tests whether value exists in sorted sequence or not.
set_union
Union of two sorted ranges The union of two sets is formed by the elements that are present in either one of the sets,
partition_point
locates the partition point of a partitioned range
inplace_merge
merges two ordered ranges in-place
merge
merges two sorted ranges