Lecture 6 - Slide 18 : 40 |

Overview of Algorithms

The C++11 Standard Library contains approximately 80 standard algorithms

Most of these represent simple ideas, as opposed to algorithms in an *Algorithms and Data Structure* course tradition

*The design here is not on the desing of algorithms or even on the use of any but the simplest and most obvious algorithms*, §18.2 in

*The C++ Prog. Lang. (3. edition)*: Page 508

*The C++ Prog. Lang. (4. edition)*: Page 927

- Nonmodifying sequence algorithms
`for-each()`: Applies a function on each element of a sequence`find()`: Find the first element that compares equal to a given value. Return iterator to element`find_if()`: Find the first element that satisfies a given predicate. Return iterator to element

- Modifying sequence algorithms
`transform()`: Applies a function on each element, and writes the result into another container.`replace()`: Replace elements that satisfies a predicate with a another value

- Sorting and searching algorithms (on sequences):
`sort``binary_search`

- Set algorithms
- Heap algorithms
`make_heap`,`push_heap`, and`pop_heap`

- Min and max algorithms
- The naive
`min`and`max`functions `max_element`and`min_element`: Generalization to sequences of elements

- The naive
- Permutation algorithms
`next_permutation`and`prev_permutation`: Systematic creation of permutations of a sequence

- Numeric algorithms