Standard Template Library – Algorithm
Algorithms are predefined function to perform a specific functionality. In STL , the built-in header files are <algorithm> and <numeric>. Algorithms can be classified into 4 types based on its functionality. 1. Sorting algorithms 2. Searching algorithms . 3. Manipulation algorithm 4. Counting and comparing algorithm Let us discuss about the algorithm in each category. 1. Sorting algorithms: This is the algorithm which arranges the element in particular order. The functions are given below. “sort()” : it arranges the elements in particular order. “nth_element()” : it rearranges the element based on the ‘n’ value. “is_sorted()”: it checks the given array is sorted or not. “is...