Home » STL
C++ Standard Template Library (STL)
C++ Standard Template Library is a very powerful library consisting of a set of classes and algorithms. C++ Standard Template Library provides highly optimized and template based implementation of commonly used data structures and algorithms.
It is very popular amongst competitive programmers and people who regularly solve data structures and algorithm based questions.
C++ STL Data Structures
1. Vector : Vector is one of the most commonly used data structure in C++. Think of it as a resizable array.
2. List: List is an implementation of a doubly linked list in C++ STL.
3. Deque: Deque is an implementation of double ended queue in C++ STL
C++ STL Common Algorithms
Utility Methods
1. Sort: Used to sort a given range.
2. Reverse: Reverse a given range in place.
3. max_element: Finds the maximum value from a given range.
4. min_element: Finds the minimum value from a given range.
Binary Search Algorithms
1. Upper_Bound: Upper_Bound method is used to find the first number greater than given number in a sorted range.
2. Lower_Bound: Lower_bound method is used to find the first number greater than or equal to the given number in a sorted range
3. Binary_Search: Binary search method is used to binary search within a sorted range.
General Methods
1. Accumulate: Accumulates value within a given range.
2. Next_permutation: Converts the existing range into its next permutation
3. Prev_permutation: Converts the existing range into its previous permutation