C++ Algorithms and Vector Functions
C++ algorithms and useful vector functions. So far, we've gone over how to access, append, remove, and update values within a vector. Outside of these methods, we can utilize the built-in algorithm library in C++ to modify and search within a vector (and other containers). Specifically, we will be using the sort, is_sorted, reverse, and fill functions to modify a vector. We will also search through a vector for values using the max_element, min_element, find, and count functions. And finally, we will go over the shuffle function with the MT19937 Mersenne Twister pseudorandom number generator to randomly shuffle a vector.
If you need to review these past C++ topics:
Templates and Generics: • C++ Templates and Generics Functions
Iterator: • C++ Iterators
Vector: • C++ Vectors and Dynamic Arrays
List of algorithm functions in the algorithm library:
https://cplusplus.com/reference/algorithm/
C++ Playlist:
• C++ Programming Tutorial
Github Repo for C++ Code:
https://github.com/ImKennyYip/cpp
Install C++ with VS Code:
• How to set up C++ in Visual Studio Code
Subscribe for more coding tutorials 😄 !
🌟 If you enjoyed the tutorial and would like to support the channel, you can do so here: https://buymeacoffee.com/kennyyipcoding