Algorithms
Lesson 18 of 23 in Coddy's C++ - Standard Template Library course.
The C++ STL provides a large number of different types of algorithms that can be implemented upon any of the container types with the help of iterators. This means that the library defines functions for a variety of purposes, such as searching or sorting that operate on ranges of elements.
This helps us in a way, so we don't need to define complex algorithms to do some simpler tasks such as searching and sorting, so we just use the built-in functions that the algorithm library of the STL provides us.
Algorithm functions provided from the library work on the iterators, not on the containers themselves. That's why one algorithm function can be used upon many different containers. The sort() functions can be used on a vector, as well as on different container types such as the array.
Algorithm Types
- Sorting Algorithms
- Searching Algorithms
- Modifying Algorithms
- Numeric Algorithms
- Minimum & Maximum Operations
Try it yourself
This lesson doesn't include a code challenge.