Académique Documents
Professionnel Documents
Culture Documents
The algorithms library denes functions for a variety of purpos es (e.g. s earching, s orting, counting,
manipulating) that operate on ranges of elements . Note that a range is dened as [first, last)where
lastrefers to the element past the las t element to ins pect or modify.
all_of (C++11)
any_of (C++11)
none_of(C++11)
for_each
count
count_if
mismatch
equal
find
find_if
find_if_not(C++11)
find_end
find_first_of
adjacent_find
nds the rs t two adjacent items that are equal (or s atis fy a given
predicate)
(func tion template)
search
search_n
copy
copy_if(C++11)
copy_n(C++11)
copy_backward
move(C++11)
move_backward(C++11)
fill
fill_n
transform
generate
generate_n
remove
remove_if
remove_copy
remove_copy_if
replace
replace_if
replaces all values s atis fying s pecic criteria with another value
(func tion template)
replace_copy
replace_copy_if
swap
swap_ranges
iter_swap
reverse
reverse_copy
rotate
rotate_copy
Partitioning operations
Dened in header <algorithm>
is_partitioned(C++11)
partition
partition_copy(C++11)
stable_partition
partition_point(C++11)
divides elements into two groups while pres erving their relative order
(func tion template)
Sorting operations
Dened in header <algorithm>
is_sorted(C++11)
is_sorted_until(C++11)
sort
partial_sort
partial_sort_copy
stable_sort
nth_element
partially s orts the given range making s ure that it is partitioned by the
given element
(func tion template)
lower_bound
upper_bound
binary_search
equal_range
Set operations (on sorted ranges)
returns an iterator to the rs t element not less than the given value
(func tion template)
merge
inplace_merge
includes
set_difference
set_intersection
is_heap(C++11)
is_heap_until(C++11)
make_heap
push_heap
pop_heap
sort_heap
Minimum/maximum operations
Dened in header <algorithm>
max
max_element
min
min_element
minmax(C++11)
minmax_element(C++11)
prev_permutation
Numeric operations
Dened in header <numeric>
iota(C++11)
accumulate
inner_product
adjacent_difference
partial_sum
C library
Dened in header <cstdlib>
qsort
bsearch
See also
C documentation for Algorithms
Retrieved from "http://en.c ppreferenc e.c om/mwiki/index.php?title=c pp/algorithm& oldid=70996"