Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/algorithm"

From cppreference.com
< cpp
m (Text replace - "/sidebar" to "/navbar")
(add short description)
Line 1: Line 1:
 
{{title | Algorithms library}}
 
{{title | Algorithms library}}
 
{{cpp/algorithm/navbar}}
 
{{cpp/algorithm/navbar}}
 +
 +
The algorithm library defines a number of functions designed to be used on ranges (sequences) of elements. The algorithms support arbitrary data structures used to implement element ranges.
 +
 +
Note, that most of the algorithms in the library accept a range as {{tt|[first, last)}}. That is, {{tt|last}} refers to the element past the last element to inspect or modify.
  
 
{{dcl list begin}}
 
{{dcl list begin}}

Revision as of 05:03, 7 August 2012

 
 
Algorithm library
Constrained algorithms and algorithms on ranges (C++20)
Constrained algorithms, e.g. ranges::copy, ranges::sort, ...
Execution policies (C++17)
Non-modifying sequence operations
Batch operations
(C++17)
Search operations
(C++11)                (C++11)(C++11)

Modifying sequence operations
Copy operations
(C++11)
(C++11)
Swap operations
Transformation operations
Generation operations
Removing operations
Order-changing operations
(until C++17)(C++11)
(C++20)(C++20)
Sampling operations
(C++17)

Sorting and related operations
Partitioning operations
Sorting operations
Binary search operations
(on partitioned ranges)
Set operations (on sorted ranges)
Merge operations (on sorted ranges)
Heap operations
Minimum/maximum operations
(C++11)
(C++17)
Lexicographical comparison operations
Permutation operations
C library
Numeric operations
Operations on uninitialized memory
 

The algorithm library defines a number of functions designed to be used on ranges (sequences) of elements. The algorithms support arbitrary data structures used to implement element ranges.

Note, that most of the algorithms in the library accept a range as [first, last). That is, last refers to the element past the last element to inspect or modify.

Template:cpp/algorithm/dcl list all any none ofTemplate:cpp/algorithm/dcl list for eachTemplate:cpp/algorithm/dcl list countTemplate:cpp/algorithm/dcl list mismatchTemplate:cpp/algorithm/dcl list equalTemplate:cpp/algorithm/dcl list findTemplate:cpp/algorithm/dcl list find endTemplate:cpp/algorithm/dcl list find first ofTemplate:cpp/algorithm/dcl list adjacent findTemplate:cpp/algorithm/dcl list searchTemplate:cpp/algorithm/dcl list search nTemplate:cpp/algorithm/dcl list copyTemplate:cpp/algorithm/dcl list copy nTemplate:cpp/algorithm/dcl list copy backwardTemplate:cpp/algorithm/dcl list moveTemplate:cpp/algorithm/dcl list move backwardTemplate:cpp/algorithm/dcl list fillTemplate:cpp/algorithm/dcl list fill nTemplate:cpp/algorithm/dcl list transformTemplate:cpp/algorithm/dcl list generateTemplate:cpp/algorithm/dcl list generate nTemplate:cpp/algorithm/dcl list removeTemplate:cpp/algorithm/dcl list remove copyTemplate:cpp/algorithm/dcl list replaceTemplate:cpp/algorithm/dcl list replace copyTemplate:cpp/algorithm/dcl list swapTemplate:cpp/algorithm/dcl list swap rangesTemplate:cpp/algorithm/dcl list iter swapTemplate:cpp/algorithm/dcl list reverseTemplate:cpp/algorithm/dcl list reverse copyTemplate:cpp/algorithm/dcl list rotateTemplate:cpp/algorithm/dcl list rotate copyTemplate:cpp/algorithm/dcl list random shuffleTemplate:cpp/algorithm/dcl list uniqueTemplate:cpp/algorithm/dcl list unique copyTemplate:cpp/algorithm/dcl list is partitionedTemplate:cpp/algorithm/dcl list partitionTemplate:cpp/algorithm/dcl list partition copyTemplate:cpp/algorithm/dcl list stable partitionTemplate:cpp/algorithm/dcl list partition pointTemplate:cpp/algorithm/dcl list is sortedTemplate:cpp/algorithm/dcl list is sorted untilTemplate:cpp/algorithm/dcl list sortTemplate:cpp/algorithm/dcl list partial sortTemplate:cpp/algorithm/dcl list partial sort copyTemplate:cpp/algorithm/dcl list stable sortTemplate:cpp/algorithm/dcl list nth elementTemplate:cpp/algorithm/dcl list lower boundTemplate:cpp/algorithm/dcl list upper boundTemplate:cpp/algorithm/dcl list binary searchTemplate:cpp/algorithm/dcl list equal rangeTemplate:cpp/algorithm/dcl list mergeTemplate:cpp/algorithm/dcl list inplace mergeTemplate:cpp/algorithm/dcl list includesTemplate:cpp/algorithm/dcl list set differenceTemplate:cpp/algorithm/dcl list set intersectionTemplate:cpp/algorithm/dcl list set symmetric differenceTemplate:cpp/algorithm/dcl list set unionTemplate:cpp/algorithm/dcl list is heapTemplate:cpp/algorithm/dcl list is heap untilTemplate:cpp/algorithm/dcl list make heapTemplate:cpp/algorithm/dcl list push heapTemplate:cpp/algorithm/dcl list pop heapTemplate:cpp/algorithm/dcl list sort heapTemplate:cpp/algorithm/dcl list maxTemplate:cpp/algorithm/dcl list max elementTemplate:cpp/algorithm/dcl list minTemplate:cpp/algorithm/dcl list min elementTemplate:cpp/algorithm/dcl list minmaxTemplate:cpp/algorithm/dcl list minmax elementTemplate:cpp/algorithm/dcl list lexicographical compareTemplate:cpp/algorithm/dcl list is permutationTemplate:cpp/algorithm/dcl list next permutationTemplate:cpp/algorithm/dcl list prev permutationTemplate:cpp/algorithm/dcl list iotaTemplate:cpp/algorithm/dcl list accumulateTemplate:cpp/algorithm/dcl list inner productTemplate:cpp/algorithm/dcl list adjacent differenceTemplate:cpp/algorithm/dcl list partial sumTemplate:cpp/algorithm/dcl list qsortTemplate:cpp/algorithm/dcl list bsearch

Contents

Non-modifying sequence operations
Defined in header <algorithm>
Modifying sequence operations
Defined in header <algorithm>
Partitioning operations
Sorting operations (on sorted ranges)
Defined in header <algorithm>
Binary search operations (on sorted ranges)
Defined in header <algorithm>
Set operations (on sorted ranges)
Defined in header <algorithm>
Heap operations
Defined in header <algorithm>
Minimum/maximum operations
Defined in header <algorithm>
Numeric operations
Defined in header <numeric>
C library
Defined in header <cstdlib>