- In STL mainly we are having
- Algorithm : Algorithm act on containers and provide means for various operations for the contents of the containers
- Containers : Containers or container classes store objects and data.
- Functions : Functors allow the working of the associated function to be customized with the help of parameters to be passed.
- Iterators : Iterators are used for working upon a sequence of values. They are the major feature that allow generality in STL.
-
Sorting : sort(startaddress, endaddress)
-
Searching : binary_search(startaddress,endaddress, valuetofind):- Returns : true if an element equal to valuetofind is found, else false.
- sort(first_iterator, last_iterator) – To sort the given vector.
- reverse(first_iterator, last_iterator) – To reverse a vector.
- max_element (first_iterator, last_iterator) – To find the maximum element of a vector.
- min_element (first_iterator, last_iterator) – To find the minimum element of a vector.
- accumulate(first_iterator, last_iterator, initial value of sum) – Does the summation of vector elements
- count(first_iterator, last_iterator,x) – To count the occurrences of x in vector.
- find(first_iterator, last_iterator, x) – Returns an iterator to the first occurence of x in vector and points to last address of vector ((name_of_vector).end()) if element is not present in vector.
- binary_search(first_iterator, last_iterator, x) – Tests whether x exists in sorted vector or not.
- lower_bound(first_iterator, last_iterator, x) – returns an iterator pointing to the first element in the range first,last) which has a value not less than ‘x’.
- upper_bound(first_iterator, last_iterator, x) – returns an iterator pointing to the first element in the range first,last)which has a value greater than ‘x’.